@@ -169,7 +169,7 @@ def group_median_float64(ndarray[float64_t, ndim=2] out,
169
169
170
170
@ cython.boundscheck (False )
171
171
@ cython.wraparound (False )
172
- def group_cumprod_float64 (float64_t[:, :] out ,
172
+ def group_cumprod_float64 (float64_t[:, ::1 ] out ,
173
173
const float64_t[:, :] values ,
174
174
const int64_t[:] labels ,
175
175
int ngroups ,
@@ -200,7 +200,7 @@ def group_cumprod_float64(float64_t[:, :] out,
200
200
cdef:
201
201
Py_ssize_t i, j, N, K, size
202
202
float64_t val
203
- float64_t[:, :] accum
203
+ float64_t[:, :: 1 ] accum
204
204
int64_t lab
205
205
206
206
N, K = (< object > values).shape
@@ -226,7 +226,7 @@ def group_cumprod_float64(float64_t[:, :] out,
226
226
227
227
@ cython.boundscheck (False )
228
228
@ cython.wraparound (False )
229
- def group_cumsum (numeric[:, :] out ,
229
+ def group_cumsum (numeric[:, ::1 ] out ,
230
230
ndarray[numeric , ndim = 2 ] values,
231
231
const int64_t[:] labels ,
232
232
int ngroups ,
@@ -257,7 +257,7 @@ def group_cumsum(numeric[:, :] out,
257
257
cdef:
258
258
Py_ssize_t i, j, N, K, size
259
259
numeric val, y, t
260
- numeric[:, :] accum, compensation
260
+ numeric[:, :: 1 ] accum, compensation
261
261
int64_t lab
262
262
263
263
N, K = (< object > values).shape
@@ -295,14 +295,14 @@ def group_cumsum(numeric[:, :] out,
295
295
296
296
@ cython.boundscheck (False )
297
297
@ cython.wraparound (False )
298
- def group_shift_indexer (int64_t[:] out , const int64_t[:] labels ,
298
+ def group_shift_indexer (int64_t[::1 ] out , const int64_t[:] labels ,
299
299
int ngroups , int periods ):
300
300
cdef:
301
301
Py_ssize_t N, i, j, ii
302
302
int offset = 0 , sign
303
303
int64_t lab, idxer, idxer_slot
304
- int64_t[:] label_seen = np.zeros(ngroups, dtype = np.int64)
305
- int64_t[:, :] label_indexer
304
+ int64_t[:: 1 ] label_seen = np.zeros(ngroups, dtype = np.int64)
305
+ int64_t[:, :: 1 ] label_indexer
306
306
307
307
N, = (< object > labels).shape
308
308
@@ -409,10 +409,10 @@ def group_fillna_indexer(ndarray[int64_t] out, ndarray[int64_t] labels,
409
409
410
410
@ cython.boundscheck (False )
411
411
@ cython.wraparound (False )
412
- def group_any_all (uint8_t[:] out ,
413
- const uint8_t[:] values ,
412
+ def group_any_all (uint8_t[::1 ] out ,
413
+ const uint8_t[::1 ] values ,
414
414
const int64_t[:] labels ,
415
- const uint8_t[:] mask ,
415
+ const uint8_t[::1 ] mask ,
416
416
object val_test ,
417
417
bint skipna ):
418
418
"""
@@ -478,8 +478,8 @@ ctypedef fused complexfloating_t:
478
478
479
479
@ cython.wraparound (False )
480
480
@ cython.boundscheck (False )
481
- def _group_add (complexfloating_t[:, :] out ,
482
- int64_t[:] counts ,
481
+ def _group_add (complexfloating_t[:, ::1 ] out ,
482
+ int64_t[::1 ] counts ,
483
483
ndarray[complexfloating_t , ndim = 2 ] values,
484
484
const int64_t[:] labels ,
485
485
Py_ssize_t min_count = 0 ):
@@ -489,8 +489,8 @@ def _group_add(complexfloating_t[:, :] out,
489
489
cdef:
490
490
Py_ssize_t i, j, N, K, lab, ncounts = len (counts)
491
491
complexfloating_t val, count, t, y
492
- complexfloating_t[:, :] sumx, compensation
493
- int64_t[:, :] nobs
492
+ complexfloating_t[:, :: 1 ] sumx, compensation
493
+ int64_t[:, :: 1 ] nobs
494
494
Py_ssize_t len_values = len (values), len_labels = len (labels)
495
495
496
496
if len_values != len_labels:
@@ -537,8 +537,8 @@ group_add_complex128 = _group_add['double complex']
537
537
538
538
@ cython.wraparound (False )
539
539
@ cython.boundscheck (False )
540
- def _group_prod (floating[:, :] out ,
541
- int64_t[:] counts ,
540
+ def _group_prod (floating[:, ::1 ] out ,
541
+ int64_t[::1 ] counts ,
542
542
ndarray[floating , ndim = 2 ] values,
543
543
const int64_t[:] labels ,
544
544
Py_ssize_t min_count = 0 ):
@@ -548,8 +548,8 @@ def _group_prod(floating[:, :] out,
548
548
cdef:
549
549
Py_ssize_t i, j, N, K, lab, ncounts = len (counts)
550
550
floating val, count
551
- floating[:, :] prodx
552
- int64_t[:, :] nobs
551
+ floating[:, :: 1 ] prodx
552
+ int64_t[:, :: 1 ] nobs
553
553
Py_ssize_t len_values = len (values), len_labels = len (labels)
554
554
555
555
if len_values != len_labels:
@@ -590,17 +590,17 @@ group_prod_float64 = _group_prod['double']
590
590
@ cython.wraparound (False )
591
591
@ cython.boundscheck (False )
592
592
@ cython.cdivision (True )
593
- def _group_var (floating[:, :] out ,
594
- int64_t[:] counts ,
593
+ def _group_var (floating[:, ::1 ] out ,
594
+ int64_t[::1 ] counts ,
595
595
ndarray[floating , ndim = 2 ] values,
596
596
const int64_t[:] labels ,
597
597
Py_ssize_t min_count = - 1 ,
598
598
int64_t ddof = 1 ):
599
599
cdef:
600
600
Py_ssize_t i, j, N, K, lab, ncounts = len (counts)
601
601
floating val, ct, oldmean
602
- floating[:, :] mean
603
- int64_t[:, :] nobs
602
+ floating[:, :: 1 ] mean
603
+ int64_t[:, :: 1 ] nobs
604
604
Py_ssize_t len_values = len (values), len_labels = len (labels)
605
605
606
606
assert min_count == - 1 , " 'min_count' only used in add and prod"
@@ -648,16 +648,16 @@ group_var_float64 = _group_var['double']
648
648
649
649
@ cython.wraparound (False )
650
650
@ cython.boundscheck (False )
651
- def _group_mean (floating[:, :] out ,
652
- int64_t[:] counts ,
651
+ def _group_mean (floating[:, ::1 ] out ,
652
+ int64_t[::1 ] counts ,
653
653
ndarray[floating , ndim = 2 ] values,
654
- const int64_t[:] labels ,
654
+ const int64_t[::1 ] labels ,
655
655
Py_ssize_t min_count = - 1 ):
656
656
cdef:
657
657
Py_ssize_t i, j, N, K, lab, ncounts = len (counts)
658
658
floating val, count, y, t
659
- floating[:, :] sumx, compensation
660
- int64_t[:, :] nobs
659
+ floating[:, :: 1 ] sumx, compensation
660
+ int64_t[:, :: 1 ] nobs
661
661
Py_ssize_t len_values = len (values), len_labels = len (labels)
662
662
663
663
assert min_count == - 1 , " 'min_count' only used in add and prod"
@@ -704,8 +704,8 @@ group_mean_float64 = _group_mean['double']
704
704
705
705
@ cython.wraparound (False )
706
706
@ cython.boundscheck (False )
707
- def _group_ohlc (floating[:, :] out ,
708
- int64_t[:] counts ,
707
+ def _group_ohlc (floating[:, ::1 ] out ,
708
+ int64_t[::1 ] counts ,
709
709
ndarray[floating , ndim = 2 ] values,
710
710
const int64_t[:] labels ,
711
711
Py_ssize_t min_count = - 1 ):
@@ -898,8 +898,8 @@ cdef inline bint _treat_as_na(rank_t val, bint is_datetimelike) nogil:
898
898
# use `const rank_t[:, :] values`
899
899
@ cython.wraparound (False )
900
900
@ cython.boundscheck (False )
901
- def group_last (rank_t[:, :] out ,
902
- int64_t[:] counts ,
901
+ def group_last (rank_t[:, ::1 ] out ,
902
+ int64_t[::1 ] counts ,
903
903
ndarray[rank_t , ndim = 2 ] values,
904
904
const int64_t[:] labels ,
905
905
Py_ssize_t min_count = - 1 ):
@@ -990,8 +990,8 @@ def group_last(rank_t[:, :] out,
990
990
# use `const rank_t[:, :] values`
991
991
@ cython.wraparound (False )
992
992
@ cython.boundscheck (False )
993
- def group_nth (rank_t[:, :] out ,
994
- int64_t[:] counts ,
993
+ def group_nth (rank_t[:, ::1 ] out ,
994
+ int64_t[::1 ] counts ,
995
995
ndarray[rank_t , ndim = 2 ] values,
996
996
const int64_t[:] labels ,
997
997
int64_t min_count = - 1 , int64_t rank = 1
@@ -1083,7 +1083,7 @@ def group_nth(rank_t[:, :] out,
1083
1083
1084
1084
@ cython.boundscheck (False )
1085
1085
@ cython.wraparound (False )
1086
- def group_rank (float64_t[:, :] out ,
1086
+ def group_rank (float64_t[:, ::1 ] out ,
1087
1087
ndarray[rank_t , ndim = 2 ] values,
1088
1088
const int64_t[:] labels ,
1089
1089
int ngroups ,
@@ -1154,8 +1154,8 @@ ctypedef fused groupby_t:
1154
1154
1155
1155
@ cython.wraparound (False )
1156
1156
@ cython.boundscheck (False )
1157
- def group_max (groupby_t[:, :] out ,
1158
- int64_t[:] counts ,
1157
+ def group_max (groupby_t[:, ::1 ] out ,
1158
+ int64_t[::1 ] counts ,
1159
1159
ndarray[groupby_t , ndim = 2 ] values,
1160
1160
const int64_t[:] labels ,
1161
1161
Py_ssize_t min_count = - 1 ):
@@ -1167,7 +1167,7 @@ def group_max(groupby_t[:, :] out,
1167
1167
groupby_t val, count, nan_val
1168
1168
ndarray[groupby_t, ndim= 2 ] maxx
1169
1169
bint runtime_error = False
1170
- int64_t[:, :] nobs
1170
+ int64_t[:, :: 1 ] nobs
1171
1171
1172
1172
# TODO(cython 3.0):
1173
1173
# Instead of `labels.shape[0]` use `len(labels)`
@@ -1229,8 +1229,8 @@ def group_max(groupby_t[:, :] out,
1229
1229
1230
1230
@ cython.wraparound (False )
1231
1231
@ cython.boundscheck (False )
1232
- def group_min (groupby_t[:, :] out ,
1233
- int64_t[:] counts ,
1232
+ def group_min (groupby_t[:, ::1 ] out ,
1233
+ int64_t[::1 ] counts ,
1234
1234
ndarray[groupby_t , ndim = 2 ] values,
1235
1235
const int64_t[:] labels ,
1236
1236
Py_ssize_t min_count = - 1 ):
@@ -1242,7 +1242,7 @@ def group_min(groupby_t[:, :] out,
1242
1242
groupby_t val, count, nan_val
1243
1243
ndarray[groupby_t, ndim= 2 ] minx
1244
1244
bint runtime_error = False
1245
- int64_t[:, :] nobs
1245
+ int64_t[:, :: 1 ] nobs
1246
1246
1247
1247
# TODO(cython 3.0):
1248
1248
# Instead of `labels.shape[0]` use `len(labels)`
@@ -1302,7 +1302,7 @@ def group_min(groupby_t[:, :] out,
1302
1302
1303
1303
@ cython.boundscheck (False )
1304
1304
@ cython.wraparound (False )
1305
- def group_cummin (groupby_t[:, :] out ,
1305
+ def group_cummin (groupby_t[:, ::1 ] out ,
1306
1306
ndarray[groupby_t , ndim = 2 ] values,
1307
1307
const int64_t[:] labels ,
1308
1308
int ngroups ,
@@ -1362,7 +1362,7 @@ def group_cummin(groupby_t[:, :] out,
1362
1362
1363
1363
@ cython.boundscheck (False )
1364
1364
@ cython.wraparound (False )
1365
- def group_cummax (groupby_t[:, :] out ,
1365
+ def group_cummax (groupby_t[:, ::1 ] out ,
1366
1366
ndarray[groupby_t , ndim = 2 ] values,
1367
1367
const int64_t[:] labels ,
1368
1368
int ngroups ,
0 commit comments