-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
BugDtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversionsIndexRelated to the Index class or subclassesRelated to the Index class or subclasses
Description
idx = pd.Index([1], dtype=object)
idx.insert(0, 1).dtype
ATM Index.insert uses Index._with_infer
to construct a result, which will cast the case here to int64 instead of retaining object. I think in this case it would be more reasonable to keep object dtype, which we'd get by just calling Index.__new__
instead of _with_infer.
We have no tests that depend on this ATM.
Metadata
Metadata
Assignees
Labels
BugDtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversionsIndexRelated to the Index class or subclassesRelated to the Index class or subclasses