@@ -1231,12 +1231,12 @@ def group_min(groupby_t[:, ::1] out,
1231
1231
@ cython.boundscheck (False )
1232
1232
@ cython.wraparound (False )
1233
1233
cdef group_cummin_max(groupby_t[:, ::1 ] out,
1234
- ndarray[groupby_t, ndim= 2 ] values,
1235
- uint8_t[:, ::1 ] mask,
1236
- const intp_t[:] labels,
1237
- int ngroups,
1238
- bint is_datetimelike,
1239
- bint compute_max):
1234
+ ndarray[groupby_t, ndim= 2 ] values,
1235
+ uint8_t[:, ::1 ] mask,
1236
+ const intp_t[:] labels,
1237
+ int ngroups,
1238
+ bint is_datetimelike,
1239
+ bint compute_max):
1240
1240
"""
1241
1241
Cumulative minimum/maximum of columns of `values`, in row groups `labels`.
1242
1242
@@ -1246,9 +1246,9 @@ cdef group_cummin_max(groupby_t[:, ::1] out,
1246
1246
Array to store cummin/max in.
1247
1247
values : array
1248
1248
Values to take cummin/max of.
1249
- mask : array[uint8_t]
1250
- If `use_mask`, then indices represent missing values,
1251
- otherwise will be passed as a zeroed array
1249
+ mask : array[uint8_t] or None
1250
+ If not None, indices represent missing values,
1251
+ otherwise the mask will not be used
1252
1252
labels : np.ndarray[np.intp]
1253
1253
Labels to group by.
1254
1254
ngroups : int
@@ -1266,16 +1266,14 @@ cdef group_cummin_max(groupby_t[:, ::1] out,
1266
1266
cdef:
1267
1267
Py_ssize_t i, j, N, K, size
1268
1268
groupby_t val, mval
1269
- ndarray[ groupby_t, ndim = 2 ] accum
1269
+ groupby_t[:, :: 1 ] accum
1270
1270
intp_t lab
1271
- uint8_t[:, ::1 ] mask_
1272
1271
bint val_is_nan, use_mask
1273
1272
1274
1273
use_mask = mask is not None
1275
- mask_ = mask if use_mask else np.zeros_like(values, dtype = np.uint8)
1276
1274
1277
1275
N, K = (< object > values).shape
1278
- accum = np.empty((ngroups, K), dtype = np.asarray(values).dtype)
1276
+ accum = np.empty((ngroups, K), dtype = np.asarray(values).dtype, order = ' C ' )
1279
1277
if groupby_t is int64_t:
1280
1278
accum[:] = - _int64_max if compute_max else _int64_max
1281
1279
elif groupby_t is uint64_t:
@@ -1293,7 +1291,7 @@ cdef group_cummin_max(groupby_t[:, ::1] out,
1293
1291
val_is_nan = False
1294
1292
1295
1293
if use_mask:
1296
- if mask_ [i, j]:
1294
+ if mask [i, j]:
1297
1295
1298
1296
# `out` does not need to be set since it
1299
1297
# will be masked anyway
0 commit comments