Skip to content

Commit 11e150d

Browse files
committed
ENH: permits unary pos for period objects
1 parent ff8b250 commit 11e150d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/core/generic.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
is_list_like,
2626
is_dict_like,
2727
is_re_compilable,
28+
is_period_arraylike,
2829
pandas_dtype)
2930
from pandas.core.dtypes.cast import maybe_promote, maybe_upcast_putmask
3031
from pandas.core.dtypes.inference import is_hashable
@@ -1038,7 +1039,7 @@ def __neg__(self):
10381039

10391040
def __pos__(self):
10401041
values = com._values_from_object(self)
1041-
if is_bool_dtype(values):
1042+
if (is_bool_dtype(values) or is_period_arraylike(values)):
10421043
arr = values
10431044
elif (is_numeric_dtype(values) or is_timedelta64_dtype(values)):
10441045
arr = operator.pos(values)

0 commit comments

Comments
 (0)