-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
Compatpandas objects compatability with Numpy or Python functionspandas objects compatability with Numpy or Python functionsDtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversionsNumeric OperationsArithmetic, Comparison, and Logical operationsArithmetic, Comparison, and Logical operations
Description
idx = pd.Index(range(5))
>>> idx
Int64Index([0, 1, 2, 3, 4], dtype='int64')
>>> idx / 0
Int64Index([0, 0, 0, 0, 0], dtype='int64')
>>> idx // 0
Int64Index([0, 0, 0, 0, 0], dtype='int64')
>>> idx % 0
Int64Index([0, 0, 0, 0, 0], dtype='int64')
>>> divmod(idx, 0)
(Int64Index([0, 0, 0, 0, 0], dtype='int64'), Int64Index([0, 0, 0, 0, 0], dtype='int64'))
>>> idx.astype('uint64') / 0
UInt64Index([0, 0, 0, 0, 0], dtype='uint64')
Others are OK:
>>> idx.__truediv__(0)
Float64Index([nan, inf, inf, inf, inf], dtype='float64')
>>> idx.astype('float64') / 0
Float64Index([nan, inf, inf, inf, inf], dtype='float64')
Metadata
Metadata
Assignees
Labels
Compatpandas objects compatability with Numpy or Python functionspandas objects compatability with Numpy or Python functionsDtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversionsNumeric OperationsArithmetic, Comparison, and Logical operationsArithmetic, Comparison, and Logical operations