BUG: GH10160 in DataFrame construction from dict with datetime64 index by kawochen · Pull Request #10269 · pandas-dev/pandas (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation14 Commits1 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

@kawochen

closes #10160
closes #9456
where DataFrame/Series construction from nested dict with datetime64 index returns a DataFrame\Series of NaNs.

@jreback

pls rebase on master and repush had an issue in the builds

jreback

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for completeness, pls also do a test (you can use a loop), with datetime.datetime and Timestamp (expected should be the same)

@jreback

ok, this overlaps with the issue in #9456 , currently with a PR of #9924 to fix

@jreback

lets define a function someting like:

put in pandas.core.common

def _dict_compat(d):
    return { _maybe_box_datetimelike(key) : value for key, value in compat.iteritems(d) } 

then can use in both places.

@jreback

@kawochen looks good so far. can you add in tests/fix for #9456 ?
i'd like to fix both in this PR (this PR can then supersede #9924)

@kawochen

@kawochen

BUG: GH9456/10160 in Series/DataFrame construction from datetime64 dict

Added _dict_compat to deal with datetime64-keyed dict BUG: GH9456 Series construction from dict with datetime64 keys BUG: GH10160 DataFrame construction from nested dict with datetime64 index

removed import

@jreback

@kawochen any progress on this? (e.g. incorporating the Series fix as well)

@kawochen

Yes I did that a few days ago. I squashed the commits when I rebased (I'm new to github, maybe I shouldn't have?).

@jreback

merged via 821542f

thanks!

FYI, when you push again, I don't know you updated (e.g. there is no notiifcation on that, only on a new PR). So if you want me to have a look, ping!

This was referenced

Jun 10, 2015

This was referenced

Sep 16, 2015

Labels

2 participants

@kawochen @jreback