Skip to content

Commit 7f9571d

Browse files
committed
Refinements
1 parent d0f6673 commit 7f9571d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pandas/core/arrays/string_.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -924,12 +924,12 @@ def _accumulate(self, name: str, *, skipna: bool = True, **kwargs) -> StringArra
924924
# We can retain the running min/max by forward/backward filling.
925925
ndarray = ndarray.copy()
926926
missing.pad_or_backfill_inplace(
927-
ndarray.T,
927+
ndarray,
928928
method="pad",
929929
axis=0,
930930
)
931931
missing.pad_or_backfill_inplace(
932-
ndarray.T,
932+
ndarray,
933933
method="backfill",
934934
axis=0,
935935
)
@@ -938,7 +938,7 @@ def _accumulate(self, name: str, *, skipna: bool = True, **kwargs) -> StringArra
938938
# the first NA value onward.
939939
idx = np.argmax(na_mask)
940940
tail = np.empty(len(ndarray) - idx, dtype="object")
941-
tail[:] = np.nan
941+
tail[:] = self.dtype.na_value
942942
ndarray = ndarray[:idx]
943943

944944
# mypy: Cannot call function of unknown type
@@ -947,7 +947,7 @@ def _accumulate(self, name: str, *, skipna: bool = True, **kwargs) -> StringArra
947947
if tail is not None:
948948
np_result = np.hstack((np_result, tail))
949949
elif na_mask is not None:
950-
np_result = np.where(na_mask, np.nan, np_result)
950+
np_result = np.where(na_mask, self.dtype.na_value, np_result)
951951

952952
result = type(self)(np_result)
953953
return result

0 commit comments

Comments
 (0)