Closed
Description
I'm getting this error when I try converting certain Series
to datetime using pd.to_datetime
, even though I pass errors='ignore'
_ = pd.to_datetime(pd.Series([['a']]*50), errors='ignore') # works
_ = pd.to_datetime(pd.Series([['a']]*51), errors='ignore') # error
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python38\lib\site-packages\pandas\core\tools\datetimes.py", line 801, in to_datetime
cache_array = _maybe_cache(arg, format, cache, convert_listlike)
File "C:\Python38\lib\site-packages\pandas\core\tools\datetimes.py", line 173, in _maybe_cache
if not should_cache(arg):
File "C:\Python38\lib\site-packages\pandas\core\tools\datetimes.py", line 137, in should_cache
unique_elements = set(islice(arg, check_count))
TypeError: unhashable type: 'list'