@@ -6725,6 +6725,8 @@ def group_add_bin_float64(ndarray[float64_t, ndim=2] out,
6725
6725
nobs = np.zeros_like(out)
6726
6726
sumx = np.zeros_like(out)
6727
6727
6728
+ if len (bins) == 0 :
6729
+ return
6728
6730
if bins[len (bins) - 1 ] == len (values):
6729
6731
ngroups = len (bins)
6730
6732
else :
@@ -6781,6 +6783,8 @@ def group_add_bin_float32(ndarray[float32_t, ndim=2] out,
6781
6783
nobs = np.zeros_like(out)
6782
6784
sumx = np.zeros_like(out)
6783
6785
6786
+ if len (bins) == 0 :
6787
+ return
6784
6788
if bins[len (bins) - 1 ] == len (values):
6785
6789
ngroups = len (bins)
6786
6790
else :
@@ -6951,6 +6955,8 @@ def group_prod_bin_float64(ndarray[float64_t, ndim=2] out,
6951
6955
nobs = np.zeros_like(out)
6952
6956
prodx = np.ones_like(out)
6953
6957
6958
+ if len (bins) == 0 :
6959
+ return
6954
6960
if bins[len (bins) - 1 ] == len (values):
6955
6961
ngroups = len (bins)
6956
6962
else :
@@ -7007,6 +7013,8 @@ def group_prod_bin_float32(ndarray[float32_t, ndim=2] out,
7007
7013
nobs = np.zeros_like(out)
7008
7014
prodx = np.ones_like(out)
7009
7015
7016
+ if len (bins) == 0 :
7017
+ return
7010
7018
if bins[len (bins) - 1 ] == len (values):
7011
7019
ngroups = len (bins)
7012
7020
else :
@@ -7186,6 +7194,8 @@ def group_var_bin_float64(ndarray[float64_t, ndim=2] out,
7186
7194
sumx = np.zeros_like(out)
7187
7195
sumxx = np.zeros_like(out)
7188
7196
7197
+ if len (bins) == 0 :
7198
+ return
7189
7199
if bins[len (bins) - 1 ] == len (values):
7190
7200
ngroups = len (bins)
7191
7201
else :
@@ -7247,6 +7257,8 @@ def group_var_bin_float32(ndarray[float32_t, ndim=2] out,
7247
7257
sumx = np.zeros_like(out)
7248
7258
sumxx = np.zeros_like(out)
7249
7259
7260
+ if len (bins) == 0 :
7261
+ return
7250
7262
if bins[len (bins) - 1 ] == len (values):
7251
7263
ngroups = len (bins)
7252
7264
else :
@@ -7412,6 +7424,8 @@ def group_mean_bin_float64(ndarray[float64_t, ndim=2] out,
7412
7424
sumx = np.zeros_like(out)
7413
7425
7414
7426
N, K = (< object > values).shape
7427
+ if len (bins) == 0 :
7428
+ return
7415
7429
if bins[len (bins) - 1 ] == len (values):
7416
7430
ngroups = len (bins)
7417
7431
else :
@@ -7465,6 +7479,8 @@ def group_mean_bin_float32(ndarray[float32_t, ndim=2] out,
7465
7479
sumx = np.zeros_like(out)
7466
7480
7467
7481
N, K = (< object > values).shape
7482
+ if len (bins) == 0 :
7483
+ return
7468
7484
if bins[len (bins) - 1 ] == len (values):
7469
7485
ngroups = len (bins)
7470
7486
else :
@@ -7520,6 +7536,8 @@ def group_ohlc_float64(ndarray[float64_t, ndim=2] out,
7520
7536
float64_t vopen, vhigh, vlow, vclose, NA
7521
7537
bint got_first = 0
7522
7538
7539
+ if len (bins) == 0 :
7540
+ return
7523
7541
if bins[len (bins) - 1 ] == len (values):
7524
7542
ngroups = len (bins)
7525
7543
else :
@@ -7594,6 +7612,8 @@ def group_ohlc_float32(ndarray[float32_t, ndim=2] out,
7594
7612
float32_t vopen, vhigh, vlow, vclose, NA
7595
7613
bint got_first = 0
7596
7614
7615
+ if len (bins) == 0 :
7616
+ return
7597
7617
if bins[len (bins) - 1 ] == len (values):
7598
7618
ngroups = len (bins)
7599
7619
else :
@@ -7801,6 +7821,8 @@ def group_last_bin_float64(ndarray[float64_t, ndim=2] out,
7801
7821
nobs = np.zeros_like(out)
7802
7822
resx = np.empty_like(out)
7803
7823
7824
+ if len (bins) == 0 :
7825
+ return
7804
7826
if bins[len (bins) - 1 ] == len (values):
7805
7827
ngroups = len (bins)
7806
7828
else :
@@ -7845,6 +7867,8 @@ def group_last_bin_float32(ndarray[float32_t, ndim=2] out,
7845
7867
nobs = np.zeros_like(out)
7846
7868
resx = np.empty_like(out)
7847
7869
7870
+ if len (bins) == 0 :
7871
+ return
7848
7872
if bins[len (bins) - 1 ] == len (values):
7849
7873
ngroups = len (bins)
7850
7874
else :
@@ -7889,6 +7913,8 @@ def group_last_bin_int64(ndarray[int64_t, ndim=2] out,
7889
7913
nobs = np.zeros_like(out)
7890
7914
resx = np.empty_like(out)
7891
7915
7916
+ if len (bins) == 0 :
7917
+ return
7892
7918
if bins[len (bins) - 1 ] == len (values):
7893
7919
ngroups = len (bins)
7894
7920
else :
@@ -8067,6 +8093,8 @@ def group_nth_bin_float64(ndarray[float64_t, ndim=2] out,
8067
8093
nobs = np.zeros_like(out)
8068
8094
resx = np.empty_like(out)
8069
8095
8096
+ if len (bin) == 0 :
8097
+ return
8070
8098
if bins[len (bins) - 1 ] == len (values):
8071
8099
ngroups = len (bins)
8072
8100
else :
@@ -8112,6 +8140,8 @@ def group_nth_bin_float32(ndarray[float32_t, ndim=2] out,
8112
8140
nobs = np.zeros_like(out)
8113
8141
resx = np.empty_like(out)
8114
8142
8143
+ if len (bin) == 0 :
8144
+ return
8115
8145
if bins[len (bins) - 1 ] == len (values):
8116
8146
ngroups = len (bins)
8117
8147
else :
@@ -8157,6 +8187,8 @@ def group_nth_bin_int64(ndarray[int64_t, ndim=2] out,
8157
8187
nobs = np.zeros_like(out)
8158
8188
resx = np.empty_like(out)
8159
8189
8190
+ if len (bin) == 0 :
8191
+ return
8160
8192
if bins[len (bins) - 1 ] == len (values):
8161
8193
ngroups = len (bins)
8162
8194
else :
@@ -8386,6 +8418,8 @@ def group_min_bin_float64(ndarray[float64_t, ndim=2] out,
8386
8418
minx = np.empty_like(out)
8387
8419
minx.fill(np.inf)
8388
8420
8421
+ if len (bins) == 0 :
8422
+ return
8389
8423
if bins[len (bins) - 1 ] == len (values):
8390
8424
ngroups = len (bins)
8391
8425
else :
@@ -8447,6 +8481,8 @@ def group_min_bin_float32(ndarray[float32_t, ndim=2] out,
8447
8481
minx = np.empty_like(out)
8448
8482
minx.fill(np.inf)
8449
8483
8484
+ if len (bins) == 0 :
8485
+ return
8450
8486
if bins[len (bins) - 1 ] == len (values):
8451
8487
ngroups = len (bins)
8452
8488
else :
@@ -8508,6 +8544,8 @@ def group_min_bin_int64(ndarray[int64_t, ndim=2] out,
8508
8544
minx = np.empty_like(out)
8509
8545
minx.fill(9223372036854775807 )
8510
8546
8547
+ if len (bins) == 0 :
8548
+ return
8511
8549
if bins[len (bins) - 1 ] == len (values):
8512
8550
ngroups = len (bins)
8513
8551
else :
@@ -8750,6 +8788,8 @@ def group_max_bin_float64(ndarray[float64_t, ndim=2] out,
8750
8788
maxx = np.empty_like(out)
8751
8789
maxx.fill(- np.inf)
8752
8790
8791
+ if len (bins) == 0 :
8792
+ return
8753
8793
if bins[len (bins) - 1 ] == len (values):
8754
8794
ngroups = len (bins)
8755
8795
else :
@@ -8810,6 +8850,8 @@ def group_max_bin_float32(ndarray[float32_t, ndim=2] out,
8810
8850
maxx = np.empty_like(out)
8811
8851
maxx.fill(- np.inf)
8812
8852
8853
+ if len (bins) == 0 :
8854
+ return
8813
8855
if bins[len (bins) - 1 ] == len (values):
8814
8856
ngroups = len (bins)
8815
8857
else :
@@ -8870,6 +8912,8 @@ def group_max_bin_int64(ndarray[int64_t, ndim=2] out,
8870
8912
maxx = np.empty_like(out)
8871
8913
maxx.fill(- 9223372036854775807 )
8872
8914
8915
+ if len (bins) == 0 :
8916
+ return
8873
8917
if bins[len (bins) - 1 ] == len (values):
8874
8918
ngroups = len (bins)
8875
8919
else :
@@ -9110,6 +9154,8 @@ def group_count_bin_float64(ndarray[float64_t, ndim=2] out,
9110
9154
ndarray[int64_t, ndim= 2 ] nobs = np.zeros((out.shape[0 ], out.shape[1 ]),
9111
9155
dtype = np.int64)
9112
9156
9157
+ if len (bins) == 0 :
9158
+ return
9113
9159
ngroups = len (bins) + (bins[len (bins) - 1 ] != N)
9114
9160
9115
9161
for i in range (N):
@@ -9144,6 +9190,8 @@ def group_count_bin_float32(ndarray[float32_t, ndim=2] out,
9144
9190
ndarray[int64_t, ndim= 2 ] nobs = np.zeros((out.shape[0 ], out.shape[1 ]),
9145
9191
dtype = np.int64)
9146
9192
9193
+ if len (bins) == 0 :
9194
+ return
9147
9195
ngroups = len (bins) + (bins[len (bins) - 1 ] != N)
9148
9196
9149
9197
for i in range (N):
@@ -9178,6 +9226,8 @@ def group_count_bin_int64(ndarray[int64_t, ndim=2] out,
9178
9226
ndarray[int64_t, ndim= 2 ] nobs = np.zeros((out.shape[0 ], out.shape[1 ]),
9179
9227
dtype = np.int64)
9180
9228
9229
+ if len (bins) == 0 :
9230
+ return
9181
9231
ngroups = len (bins) + (bins[len (bins) - 1 ] != N)
9182
9232
9183
9233
for i in range (N):
@@ -9212,6 +9262,8 @@ def group_count_bin_object(ndarray[object, ndim=2] out,
9212
9262
ndarray[int64_t, ndim= 2 ] nobs = np.zeros((out.shape[0 ], out.shape[1 ]),
9213
9263
dtype = np.int64)
9214
9264
9265
+ if len (bins) == 0 :
9266
+ return
9215
9267
ngroups = len (bins) + (bins[len (bins) - 1 ] != N)
9216
9268
9217
9269
for i in range (N):
@@ -9246,6 +9298,8 @@ def group_count_bin_int64(ndarray[int64_t, ndim=2] out,
9246
9298
ndarray[int64_t, ndim= 2 ] nobs = np.zeros((out.shape[0 ], out.shape[1 ]),
9247
9299
dtype = np.int64)
9248
9300
9301
+ if len (bins) == 0 :
9302
+ return
9249
9303
ngroups = len (bins) + (bins[len (bins) - 1 ] != N)
9250
9304
9251
9305
for i in range (N):
0 commit comments