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

Resampling with NaT in TimedeltaIndex raises MemoryError #22253

Merged
merged 1 commit into from Aug 9, 2018

Conversation

discort
Copy link
Contributor

@discort discort commented Aug 8, 2018

@@ -648,7 +648,7 @@ Groupby/Resample/Rolling
``SeriesGroupBy`` when the grouping variable only contains NaNs and numpy version < 1.13 (:issue:`21956`).
- Multiple bugs in :func:`pandas.core.Rolling.min` with ``closed='left'` and a
datetime-like index leading to incorrect results and also segfault. (:issue:`21704`)
-
- Bug in :meth:`DataFrame.resample` when resampling NaT in `TimeDeltaIndex` (:issue:`13223`).
Copy link
Contributor

Choose a reason for hiding this comment

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

use double-backticks on NaT and on TDI

Copy link
Contributor

Choose a reason for hiding this comment

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

I would take this in 0.23.5

@@ -2887,6 +2887,16 @@ def test_asfreq_bug(self):
freq='1T'))
assert_frame_equal(result, expected)

def test_resampling_with_nat(self):
# GH 13223
Copy link
Contributor

Choose a reason for hiding this comment

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

can you see if you move this to Base, so it runs on DTI, Period, and DTI (use self.create_series() then add a NaT).

alternatively you can just write separate tests for DTI and Period (we may have for DTI already), pls indicate if so.

Copy link
Contributor Author

@discort discort Aug 9, 2018

Choose a reason for hiding this comment

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

Yeah, there are tests for DTI and for Period. So, I added a test for TimeDelta. Let me know if I need to update it by create_series

Copy link
Contributor

Choose a reason for hiding this comment

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

k thanks, if you are interested in consolidating these into Base (new PR) would be great (if its easy)

@jreback jreback added Bug Timedelta Timedelta data type Resample resample method labels Aug 9, 2018
@jreback jreback added this to the 0.23.5 milestone Aug 9, 2018
@codecov
Copy link

codecov bot commented Aug 9, 2018

Codecov Report

Merging #22253 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #22253      +/-   ##
==========================================
- Coverage   92.07%   92.07%   -0.01%     
==========================================
  Files         169      169              
  Lines       50684    50682       -2     
==========================================
- Hits        46668    46666       -2     
  Misses       4016     4016
Flag Coverage Δ
#multiple 90.48% <100%> (-0.01%) ⬇️
#single 42.34% <0%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/resample.py 96.08% <100%> (-0.01%) ⬇️
pandas/core/indexes/multi.py 95.25% <0%> (-0.09%) ⬇️
pandas/util/_depr_module.py 67.44% <0%> (+2.32%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3bcc2bb...1a7d3dc. Read the comment docs.

@jreback jreback merged commit bca136f into pandas-dev:master Aug 9, 2018
lumberbot-app bot pushed a commit that referenced this pull request Aug 9, 2018
Sup3rGeo pushed a commit to Sup3rGeo/pandas that referenced this pull request Oct 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Resample resample method Timedelta Timedelta data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resampling with NaT in TimedeltaIndex raises MemoryError
2 participants