-
-
Notifications
You must be signed in to change notification settings - Fork 19.5k
Open
Labels
DeprecateFunctionality to remove in pandasFunctionality to remove in pandasNeeds DiscussionRequires discussion from core team before further actionRequires discussion from core team before further actionSeriesSeries data structureSeries data structureTransformationse.g. cumsum, diff, ranke.g. cumsum, diff, rank
Description
Ref: #63444
Prior to the PR linked to the above issue, Series.round would raise on only object dtype and be a no-op on other dtypes that did not support rounding. The behavior is also the same for Series.clip.
ser = pd.Series(pd.Categorical([1.234], categories=[1.234]))
print(ser.abs())
# TypeError: Object with dtype category cannot perform the numpy op absolute
print(ser.round())
# 0 1.234
# dtype: category
# Categories (1, float64): [1.234]
print(ser.clip())
# 0 1.234
# dtype: category
# Categories (1, float64): [1.234]
ser = pd.Series(["a"], dtype=str)
print(ser.abs())
# pyarrow.lib.ArrowNotImplementedError: Function 'abs_checked' has no kernel matching input types (large_string)
print(ser.round())
# 0 a
# dtype: str
print(ser.clip())
# 0 a
# dtype: strI think we should deprecate Series.round and Series.clip from being a no-op. The corresponding DataFrame methods are to still be no-ops on such columns.
Metadata
Metadata
Assignees
Labels
DeprecateFunctionality to remove in pandasFunctionality to remove in pandasNeeds DiscussionRequires discussion from core team before further actionRequires discussion from core team before further actionSeriesSeries data structureSeries data structureTransformationse.g. cumsum, diff, ranke.g. cumsum, diff, rank