Skip to content

Commit 401e42f

Browse files
committed
Assorted fixes
1 parent 0f586a2 commit 401e42f

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

pandas/_libs/index.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ cdef class IndexEngine:
140140

141141
cdef readonly:
142142
ndarray values
143-
ndarray mask
143+
object mask
144144
HashTable mapping
145145
bint over_size_threshold
146146

pandas/core/algorithms.py

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import warnings
1717

1818
import numpy as np
19+
from pandas_mask import PandasMaskArray
1920

2021
from pandas._libs import (
2122
algos,
@@ -1173,6 +1174,8 @@ def take(
11731174
... )
11741175
array([ 10, 10, -10])
11751176
"""
1177+
if isinstance(arr, PandasMaskArray): # TODO: implement take directly on mask
1178+
arr = np.array(arr)
11761179
if not isinstance(
11771180
arr,
11781181
(np.ndarray, ABCExtensionArray, ABCIndex, ABCSeries, ABCNumpyExtensionArray),

pandas/core/groupby/ops.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ def _cython_op_ndim_compat(
324324
# expand to 2d, dispatch, then squeeze if appropriate
325325
values2d = values[None, :]
326326
if mask is not None:
327-
mask = mask[None, :]
327+
mask = np.array(mask)[None, :]
328328
if result_mask is not None:
329329
result_mask = result_mask[None, :]
330330
res = self._call_cython_op(

0 commit comments

Comments
 (0)