Skip to content

changed shape argument for ndarray from int to tuple in ./core/strings/object_array.py #44352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Nov 16, 2021
8 changes: 3 additions & 5 deletions pandas/core/strings/object_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import pandas._libs.missing as libmissing
import pandas._libs.ops as libops
from pandas._typing import (
Dtype,
NpDtype,
Scalar,
)

Expand All @@ -37,7 +37,7 @@ def __len__(self):
raise NotImplementedError

def _str_map(
self, f, na_value=None, dtype: Dtype | None = None, convert: bool = True
self, f, na_value=None, dtype: NpDtype | None = None, convert: bool = True
):
"""
Map a callable over valid elements of the array.
Expand All @@ -62,9 +62,7 @@ def _str_map(
na_value = self._str_na_value

if not len(self):
# error: Argument 1 to "ndarray" has incompatible type "int";
# expected "Sequence[int]"
return np.ndarray(0, dtype=dtype) # type: ignore[arg-type]
return np.ndarray(0, dtype=dtype)

arr = np.asarray(self, dtype=object)
mask = isna(arr)
Expand Down