-
-
Notifications
You must be signed in to change notification settings - Fork 19.4k
Closed
Labels
BugDtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversionsIndexRelated to the Index class or subclassesRelated to the Index class or subclasses
Milestone
Description
-
I have checked that this issue has not already been reported.
-
I have confirmed this bug exists on the latest version of pandas.
-
I have confirmed this bug exists on the master branch of pandas.
Reproducible Example
import pandas as pd
idx = pd.NumericIndex([1.0, 2.0, 3.0] dtype='int32')
result = idx.insert(1, 4.0)
assert result.dtype == idx.dtype # <- nope!
### Issue Description
cc @topper-123
### Expected Behavior
Should preserve type and dtype
### Installed Versions
<details>
Replace this line with the output of pd.show_versions()
</details>
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