Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Timestamp cannot be compared to np.int64: impact on series binary operations #8058
Comments
l736x
commented
Aug 18, 2014
jreback
added the
Dtypes
label
Aug 18, 2014
jreback
added this to the
0.15.1
milestone
Aug 18, 2014
|
I think should raise That said I think its easy to put a try: except: around this comparison, catch the might also create a small function in core/common.py to make this more transparent (as it might be used elsewhere) |
|
@jreback Actually, I think e.g., even on Python 3:
|
l736x
commented
Aug 18, 2014
|
I agree with @shoyer , I think in general it makes sense that |
|
@l736x well go ahead and put up a pr for that |
l736x
commented
Aug 18, 2014
|
I'm sorry but I'm a humble reporter of bugs. |
l736x commentedAug 18, 2014
Binary operations between two series fail if the .name attribute of the first is a Timestamp and the .name of the second is a numpy.int64.
It seems a corner case, but it's pretty common when the series are slices of dataframes.
It happens independently if, say, + or .add() is used.
It doesn't happen if the order is reversed.
I guess it boils down to Timestamps not having a sufficiently wide equal method.