You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In sufficiently old numpy (the build that caught this bug was running 1.9.2) timedelta64 comparisons have unexpected behavior:
value = np.timedelta64(1, 'ns')
new_value = int(value)
assert value == new_value # <-- raises with modern numpy, passes with older versions
This particular comparison is done in the RangeIndex constructor, the result being that sometimesRangeIndex(value, value*10, value) returns RangeIndex(1, 10, 1) instead of raising.
The immediate problem can be fixed by checking more carefully in the RangeIndex constructor. No idea if there are other places that are affected.
A related behavior that I find unhelpful that is present with 1.14.1 is:
what is the purpose of opening a separate issue for this? this is a well known detail of how np.timedelta64 are implemented. which is True for all numpies (the 2nd part)
Ref #19333
In sufficiently old numpy (the build that caught this bug was running 1.9.2) timedelta64 comparisons have unexpected behavior:
This particular comparison is done in the
RangeIndex
constructor, the result being that sometimesRangeIndex(value, value*10, value)
returnsRangeIndex(1, 10, 1)
instead of raising.The immediate problem can be fixed by checking more carefully in the RangeIndex constructor. No idea if there are other places that are affected.
A related behavior that I find unhelpful that is present with 1.14.1 is:
The text was updated successfully, but these errors were encountered: