-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Open
Labels
BugExtensionArrayExtending pandas with custom dtypes or arrays.Extending pandas with custom dtypes or arrays.IndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselvessetitem-with-expansion
Description
From #32271, when setting with enlargment, the dtype gets converted into object dtype (while for normal integer or boolean dtype this is not the case):
In [10]: s = pd.Series([1, 2, 3], dtype="Int64")
In [11]: s[3] = 4
In [12]: s
Out[12]:
0 1
1 2
2 3
3 4
dtype: object
In [13]: s = pd.Series([1, 2, 3], dtype="int64")
In [14]: s[3] = 4
In [15]: s
Out[15]:
0 1
1 2
2 3
3 4
dtype: int64
It also happens with eg DecimalArray from our tests, so suppose it is a general issue with ExtensionArrays.
Metadata
Metadata
Assignees
Labels
BugExtensionArrayExtending pandas with custom dtypes or arrays.Extending pandas with custom dtypes or arrays.IndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselvessetitem-with-expansion