-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Problem constructing Series from dict with datetime.date in level of MultiIndex #10060
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
P.S. |
it seems the same question is #8802 You can do this if you really want.
This is in general not very useful, much slower, and harder to deal with. Is their a reason you insist on using |
It's not really the same question. In the previous question I had a problem with the new version forcing dates to Timestamps which caused existing code not to work. I've adopted this and the code I write now doesn't use datetime.date objects in the index. However, I'm working with data which is produced by existing programmes written by others which isn't aimed at Pandas and has a dictionary with tuple keys containing datetime.date objects which I would like to convert to Pandas. |
prob related to this: #9456 pull-requests welcome for fixing that (and you can use this as a test case as well) |
When calling the Series constructor on a dict with tuple keys containing a datetime.date object
the values are converted to NaNs as this example demonstrates:
It only happens with MultiIndex but otherwise arises regardless of the number and order of the levels.
I know having datetime.date objects in an index is not optimal and that calling the constructor in this way actually forces the dates to Timestamp objects but in my use case I'm receiving data which is structured this way and converting it to Pandas objects.
The text was updated successfully, but these errors were encountered: