-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: to_datetime throws TypeError: unhashable type: 'list' even with errors='ignore' #39756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks @adamerose - could you please upload your in a format other than https://docs.python.org/3/library/pickle.html :
|
Hi you can load it from my arangodb server import pandas as pd client = ArangoClient(hosts='http://bjhjemme.duckdns.org:8529') db = client.db('test_2015-2020', username='test', password='test') aql = db.aql cursor = db.aql.execute('FOR c IN FORM_3 RETURN c', batch_size=1) df = pd.json_normalize(result, max_level=None) df = df.drop(columns=['_key', '_id', '_rev']) You can brows the files in http://bjhjemme.duckdns.org:8529 logg in with test and test |
This reproduces it with no other packages needed:
|
Thanks @adamerose simpler reproducer: >>> _ = 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 "/home/marco/pandas-marco/pandas/core/tools/datetimes.py", line 814, in to_datetime
cache_array = _maybe_cache(arg, format, cache, convert_listlike)
File "/home/marco/pandas-marco/pandas/core/tools/datetimes.py", line 186, in _maybe_cache
if not should_cache(arg):
File "/home/marco/pandas-marco/pandas/core/tools/datetimes.py", line 150, in should_cache
unique_elements = set(islice(arg, check_count))
TypeError: unhashable type: 'list' |
@adamrose - I've removed the link to your pickle file in the OP. In general one should not load pickles unless the source is trusted as they can execute arbitrary code. |
@rhendric Understood, no problem. I only resorted to posting that because I couldn't figure out a way to reproduce it programmatically initially. Thanks for providing that @MarcoGorelli, I'll edit that into the OP |
I'm getting this error when I try converting certain
Series
to datetime usingpd.to_datetime
, even though I passerrors='ignore'
The text was updated successfully, but these errors were encountered: