You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/01/16 22:31:10 UTC
[GitHub] rberenguel edited a comment on issue #18139: [SPARK-20787][PYTHON]
PySpark can't handle datetimes before 1900
rberenguel edited a comment on issue #18139: [SPARK-20787][PYTHON] PySpark can't handle datetimes before 1900
URL: https://github.com/apache/spark/pull/18139#issuecomment-454968882
Didn't think about that one, Arrow is at least a soft dependency. @HyukjinKwon: seems to at least work for the problematic area:
```python
>>> import pandas as pd
>>> import pyarrow as pa
>>> import numpy as np
>>> df = pd.DataFrame({'datetime64': np.array(['1901-07-13T01:23:34.123456789', '1902-01-13T12:34:56.432539784', '1899-08-13T05:46
:57.437699912'], dtype='datetime64[ns]')})
>>> b = pa.Table.from_pandas(df)
>>> b[0].to_pandas()
0 1901-07-13 01:23:34.123456789
1 1902-01-13 12:34:56.432539784
2 1899-08-13 05:46:57.437699912
Name: datetime64, dtype: datetime64[ns]
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org