Skip to content
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

BUG: resample raises ValueError when NaT is included #7373

Merged
merged 1 commit into from Jun 14, 2014

Conversation

sinhrks
Copy link
Member

@sinhrks sinhrks commented Jun 6, 2014

Closes #7227. resample(how=count) should work now.

There are some aggregations which doesn't work with TimeGrouper yet, I'll open separate issue.

@jreback jreback added this to the 0.14.1 milestone Jun 6, 2014
dt_result = getattr(dt_grouped, func)()
assert_frame_equal(expected, dt_result)

# if NaT is included, 'var', 'std', 'mean', 'size', 'first','last' and 'nth' doesn't work yet
Copy link
Contributor

Choose a reason for hiding this comment

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

I get var/std/mean should raise (so add a test for these). the rest should work though, no?

@sinhrks
Copy link
Member Author

sinhrks commented Jun 6, 2014

There seems to be 3 issues related to aggregation.

  • var/std/mean raises ValueError when group key contains NaT. (Error will be changed after this PR, but still fails)
  • size raises AttributeError regardless of NaT existence.
  • first/last/nth looks work, but BinGrouper seems to sort rows differently from normal groupby. Thus, result of normal groupby and TimeGrouper can differ. If we test (like test_aggregate_normal included in this PR), it fails.

@sinhrks
Copy link
Member Author

sinhrks commented Jun 7, 2014

The PR requires Index.insert to preserve index name (#7386). I'll rebase once it merged.

@jreback
Copy link
Contributor

jreback commented Jun 11, 2014

why does size raise? (this should work)

how is the BinGrouper sorting different? can you show an example?

@sinhrks
Copy link
Member Author

sinhrks commented Jun 14, 2014

Issued #7453 to explain size and first/last/nth issue, because these are irrelevant from this issue.

@jreback
Copy link
Contributor

jreback commented Jun 14, 2014

ok....going to merge this, and use #7453 to address the other issues

jreback added a commit that referenced this pull request Jun 14, 2014
BUG: resample raises ValueError when NaT is included
@jreback jreback merged commit 8cfff98 into pandas-dev:master Jun 14, 2014
@sinhrks sinhrks deleted the resamplenat branch June 14, 2014 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Groupby Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: resample/groupby with NaT in the grouper
2 participants