-
- Notifications
You must be signed in to change notification settings - Fork 19.4k
Closed
Labels
ExtensionArrayExtending pandas with custom dtypes or arrays.Extending pandas with custom dtypes or arrays.good first issue
Milestone
Description
In [9]: from pandas.tests.extension.decimal import to_decimal In [10]: to_decimal([1, 2]).shift(4) Out[10]: DecimalArray(array([Decimal('NaN'), Decimal('NaN'), Decimal('NaN'), Decimal('NaN')], dtype=object))The expected output is
>>> to_decimal(['NaN', 'NaN']) DecimalArray(array([Decimal('NaN'), Decimal('NaN')], dtype=object))similar to categorical
In [12]: pd.Categorical([1, 2]).shift(4) Out[12]: [NaN, NaN] Categories (2, int64): [1, 2]This will need a new base test in tests/extension/base/methods.py and a fix in
pandas/pandas/core/arrays/base.py
Line 430 in a7b187a
| def shift(self, periods=1): |
Metadata
Metadata
Assignees
Labels
ExtensionArrayExtending pandas with custom dtypes or arrays.Extending pandas with custom dtypes or arrays.good first issue