Skip to content

Commit 3e56638

Browse files
committed
typing failed, less typing
1 parent deaa6bb commit 3e56638

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

pandas/core/arrays/masked.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@
9393

9494
from pandas.compat.numpy import function as nv
9595

96-
_BaseMaskedArrayT = TypeVar("_BaseMaskedArrayT", bound="BaseMaskedArray")
97-
9896

9997
class BaseMaskedArray(OpsMixin, ExtensionArray):
10098
"""
@@ -1429,9 +1427,7 @@ def _groupby_op(
14291427
return self._maybe_mask_result(res_values, result_mask)
14301428

14311429

1432-
def transpose_homogenous_masked_arrays(
1433-
masked_arrays: list[_BaseMaskedArrayT],
1434-
) -> list[_BaseMaskedArrayT]:
1430+
def transpose_homogenous_masked_arrays(masked_arrays):
14351431
"""Transpose masked arrays in a list, but faster.
14361432
14371433
Input should be a list of 1-dim masked arrays of equal length and all have the

pandas/core/frame.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -3596,8 +3596,10 @@ def transpose(self, *args, copy: bool = False) -> DataFrame:
35963596
if isinstance(dtypes[0], BaseMaskedDtype):
35973597
# We have masked arrays with the same dtype. We can transpose faster.
35983598
from pandas.core.arrays.masked import transpose_homogenous_masked_arrays
3599-
3600-
masked_arrays = [blk.values for blk in self._mgr.blocks]
3599+
if isinstance(self._mgr, ArrayManager):
3600+
masked_arrays = [arr for arr in self._mgr.arrays]
3601+
else:
3602+
masked_arrays = [blk.values for blk in self._mgr.blocks]
36013603
new_values = transpose_homogenous_masked_arrays(masked_arrays)
36023604
else:
36033605
# We have other EAs with the same dtype. We preserve dtype in transpose.

0 commit comments

Comments
 (0)