We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ffb2a6f commit bd1b70cCopy full SHA for bd1b70c
pandas/core/arrays/arrow/array.py
@@ -1478,10 +1478,12 @@ def to_numpy(
1478
return result
1479
1480
def map(self, mapper, na_action: Literal["ignore"] | None = None):
1481
- if (
1482
- is_numeric_dtype(self.dtype)
1483
- or pa.types.is_date(self.dtype.pyarrow_dtype)
1484
- or pa.types.is_timestamp(self.dtype.pyarrow_dtype)
+ if not is_string_dtype(self.dtype) and any(
+ [
+ is_numeric_dtype(self.dtype)
+ or pa.types.is_date(self.dtype.pyarrow_dtype)
1485
+ or pa.types.is_timestamp(self.dtype.pyarrow_dtype)
1486
+ ]
1487
):
1488
return map_array(self.to_numpy(), mapper, na_action=na_action)
1489
else:
0 commit comments