-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH GH20601 raise error when pivot table's number of levels > int32 #20709
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
Closed
anhqle
wants to merge
34
commits into
pandas-dev:0.22.x
from
anhqle:GH20601-large-pivot-table-int32-overflow
+7,361
−6,381
Closed
Changes from 3 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
a635140
ENH GH20601 raise an error when the number of levels in a pivot table…
anhqle ac224f5
TST add a test for pivot table large number of levels causing int32 o…
anhqle acbc4eb
CLN PEP8 compliance
anhqle 662ce5f
DOC add whatsnew entry
anhqle 804101c
Fix issue 17912 (#20705)
CianciuStyles 1e4e04b
ENH: ExtensionArray.setitem (#19907)
TomAugspurger 8756f55
DEP: Add 'python_requires' to setup.py to drop 3.4 support (#20698)
djhoese da33359
DOC: Correct documentation to GroupBy.rank (#20708)
gfyoung 4a34497
API: rolling.apply will pass Series to function (#20584)
jreback 6245e8c
TST: add tests for take() on empty arrays (#20582)
jorisvandenbossche 75295e1
CLN: Replacing %s with .format in pandas/core/frame.py (#20461)
AaronCritchley bb095a6
change the indent for the pydoc of apply() function. (#20715)
zhao-zihao 7ed1f53
PKG: remove pyproject.toml for now (#20718)
jorisvandenbossche b9f826f
DOC: use apply(raw=True) in docs to silence warning (#20741)
jorisvandenbossche 07739aa
Fix more tests expecting little-endian (#20738)
ginggs ede11af
DOC: add coverage href to README.md (#20736)
wuhaochen 78fee04
DEPR: Deprecate DatetimeIndex.offset in favor of DatetimeIndex.freq (…
jschendel 3e691a4
ENH: DataFrame.append preserves columns dtype if possible (#19021)
topper-123 be057a1
DOC: Clean up badges in README (#20749)
wuhaochen 3a2e9e6
BUG: fixes indexing with monotonic decreasing DTI (#19362) (#20677)
mapehe 23bc217
DOC: Various EA docs (#20707)
TomAugspurger 54470f3
BUG: unexpected assign by a single-element list (GH19474) (#20732)
kittoku 669d9b2
Add interpolate to doc string (#20776)
topper-123 336fba7
TST: #20720
jreback 7e75e4a
Fixed WOM offset when n=0 (#20549)
0d199e4
BUG: Fix problems in group rank when both nans and infinity are prese…
peterpanmj 8def649
TST: split test_groupby.py (#20781)
jreback 466f90a
ENH GH20601 raise an error when the number of levels in a pivot table…
anhqle dc982de
TST add a test for pivot table large number of levels causing int32 o…
anhqle ea53feb
CLN PEP8 compliance
anhqle 50d5e02
DOC add whatsnew entry
anhqle 90b7624
ENH catch the int32 overflow error earlier and in two separate places…
anhqle 8baba4b
CLN git merge clean up
anhqle 2416db1
CLN edit whatsnew entry and remove old code
anhqle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1237,6 +1237,16 @@ def test_pivot_string_func_vs_func(self, f, f_numpy): | |
aggfunc=f_numpy) | ||
tm.assert_frame_equal(result, expected) | ||
|
||
@pytest.mark.slow | ||
def test_pivot_number_of_levels_larger_than_int32(self): | ||
# GH 20601 | ||
data = DataFrame({'ind1': list(range(1337600)) * 2, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. instead of using |
||
'ind2': list(range(3040)) * 2 * 440, | ||
'count': [1] * 2 * 1337600}) | ||
with tm.assert_raises_regex(ValueError, 'int32 overflow'): | ||
data.pivot_table(index='ind1', columns='ind2', | ||
values='count', aggfunc='count') | ||
|
||
|
||
class TestCrosstab(object): | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jreback : Is it okay to catch it here, or should we try to catch earlier as you mentioned before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to make any change, and would love to hear the reasoning for catching it earlier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ideally as soon as you know this is out of bounds you want to raise.