Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Fix overflow error in cartesian_product #15265
Conversation
codecov-io
commented
Jan 30, 2017
•
Codecov Report@@ Coverage Diff @@
## 0.19.x #15265 +/- ##
=======================================
Coverage 85.27% 85.27%
=======================================
Files 144 144
Lines 50946 50946
=======================================
Hits 43444 43444
Misses 7502 7502
Continue to review full report at Codecov.
|
|
need a test for this (IOW something simple that fails w/o the fix and passes with it). best way is to step thru your code until you hit this and see what the inputs are (to cartesian product) and can use that as a test. need a whats new (bug fix) as well. |
jreback
added Compat Windows
labels
Jan 30, 2017
| + X = np.arange(65536) | ||
| + Y = np.arange(65535) | ||
| + result1, result2 = cartesian_product([X, Y]) | ||
| + expected_size = X.size * Y.size |
david-hoffman
Jan 30, 2017
Contributor
I couldn't think of another way to cause the error without adding checking code to the cartesian_product function itself, e.g.
if np.any(cumprodX < 0):
raise RuntimeError(...)
jreback
Jan 30, 2017
Contributor
so, let's take the test out (just verify what you were doing works on windows).
pls add a whatsnew note and can merge
note that this is still buggy, because we do the cartesian product in the first place (this is #14942), so I think this will still break for you (just in a different place now).
david-hoffman
Jan 30, 2017
Contributor
Yeah, I switched to an altered version of numpy's histogramdd for this problem.
jreback
added this to the
0.20.0
milestone
Jan 30, 2017
|
ping on green. |
david-hoffman
added some commits
Jan 30, 2017
jreback
closed this
in 48fc9d6
Feb 1, 2017
|
thanks @david-hoffman FYI, you were actually branched off of the 0.19.x branch, rather than master, but I picked the commit. |
AnkurDedania
added a commit
to AnkurDedania/pandas
that referenced
this pull request
Mar 21, 2017
|
|
david-hoffman + AnkurDedania |
cfb916e
|
david-hoffman commentedJan 30, 2017
When the numbers in
Xare large it can cause an overflow error on windows machine where the nativeintis 32 bit. Switching to np.intp alleviates this problem.Other fixes would include switching to np.uint32 or np.uint64.
#15234