You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to import a csv file into a PostgreSQL table using odo. During import, odo tries to automatically detect date columns using pd.to_datetime with errors='ignore'. However, with one of my columns (that isn't a date column, it's some kind of zip code), pd.to_datetime raises an AttributeError.
I have been able to narrow down the problem to this small snippet:
>>> pd.to_datetime(pd.Series(['01210', np.nan]), errors='ignore')
Traceback (most recent call last):
File "pandas\tslib.pyx", line 1952, in pandas.tslib.array_to_datetime (pandas\tslib.c:35219)
File "pandas\tslib.pyx", line 1432, in pandas.tslib._check_dts_bounds (pandas\tslib.c:26809)
pandas.tslib.OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 1210-01-01 00:00:00
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "pandas\tslib.pyx", line 1981, in pandas.tslib.array_to_datetime (pandas\tslib.c:35724)
File "pandas\tslib.pyx", line 1975, in pandas.tslib.array_to_datetime (pandas\tslib.c:35602)
File "pandas\tslib.pyx", line 1228, in pandas.tslib.convert_to_tsobject (pandas\tslib.c:23563)
File "pandas\tslib.pyx", line 1432, in pandas.tslib._check_dts_bounds (pandas\tslib.c:26809)
pandas.tslib.OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 1210-01-01 00:00:00
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Miniconda3\envs\py35\lib\site-packages\pandas\util\decorators.py", line 89, in wrapper
return func(*args, **kwargs)
File "C:\Miniconda3\envs\py35\lib\site-packages\pandas\tseries\tools.py", line 276, in to_datetime
unit=unit, infer_datetime_format=infer_datetime_format)
File "C:\Miniconda3\envs\py35\lib\site-packages\pandas\tseries\tools.py", line 390, in _to_datetime
values = _convert_listlike(arg._values, False, format)
File "C:\Miniconda3\envs\py35\lib\site-packages\pandas\tseries\tools.py", line 372, in _convert_listlike
require_iso8601=require_iso8601)
File "pandas\tslib.pyx", line 1847, in pandas.tslib.array_to_datetime (pandas\tslib.c:37155)
File "pandas\tslib.pyx", line 2005, in pandas.tslib.array_to_datetime (pandas\tslib.c:36116)
AttributeError: 'float' object has no attribute 'view'
I'm trying to import a csv file into a PostgreSQL table using odo. During import,
odo
tries to automatically detect date columns usingpd.to_datetime
witherrors='ignore'
. However, with one of my columns (that isn't a date column, it's some kind of zip code),pd.to_datetime
raises an AttributeError.I have been able to narrow down the problem to this small snippet:
output of
pd.show_versions()
The text was updated successfully, but these errors were encountered: