@@ -6725,6 +6725,8 @@ def group_add_bin_float64(ndarray[float64_t, ndim=2] out,
67256725 nobs = np.zeros_like(out)
67266726 sumx = np.zeros_like(out)
67276727
6728+ if len (bins) == 0 :
6729+ return
67286730 if bins[len (bins) - 1 ] == len (values):
67296731 ngroups = len (bins)
67306732 else :
@@ -6781,6 +6783,8 @@ def group_add_bin_float32(ndarray[float32_t, ndim=2] out,
67816783 nobs = np.zeros_like(out)
67826784 sumx = np.zeros_like(out)
67836785
6786+ if len (bins) == 0 :
6787+ return
67846788 if bins[len (bins) - 1 ] == len (values):
67856789 ngroups = len (bins)
67866790 else :
@@ -6951,6 +6955,8 @@ def group_prod_bin_float64(ndarray[float64_t, ndim=2] out,
69516955 nobs = np.zeros_like(out)
69526956 prodx = np.ones_like(out)
69536957
6958+ if len (bins) == 0 :
6959+ return
69546960 if bins[len (bins) - 1 ] == len (values):
69556961 ngroups = len (bins)
69566962 else :
@@ -7007,6 +7013,8 @@ def group_prod_bin_float32(ndarray[float32_t, ndim=2] out,
70077013 nobs = np.zeros_like(out)
70087014 prodx = np.ones_like(out)
70097015
7016+ if len (bins) == 0 :
7017+ return
70107018 if bins[len (bins) - 1 ] == len (values):
70117019 ngroups = len (bins)
70127020 else :
@@ -7186,6 +7194,8 @@ def group_var_bin_float64(ndarray[float64_t, ndim=2] out,
71867194 sumx = np.zeros_like(out)
71877195 sumxx = np.zeros_like(out)
71887196
7197+ if len (bins) == 0 :
7198+ return
71897199 if bins[len (bins) - 1 ] == len (values):
71907200 ngroups = len (bins)
71917201 else :
@@ -7247,6 +7257,8 @@ def group_var_bin_float32(ndarray[float32_t, ndim=2] out,
72477257 sumx = np.zeros_like(out)
72487258 sumxx = np.zeros_like(out)
72497259
7260+ if len (bins) == 0 :
7261+ return
72507262 if bins[len (bins) - 1 ] == len (values):
72517263 ngroups = len (bins)
72527264 else :
@@ -7412,6 +7424,8 @@ def group_mean_bin_float64(ndarray[float64_t, ndim=2] out,
74127424 sumx = np.zeros_like(out)
74137425
74147426 N, K = (< object > values).shape
7427+ if len (bins) == 0 :
7428+ return
74157429 if bins[len (bins) - 1 ] == len (values):
74167430 ngroups = len (bins)
74177431 else :
@@ -7465,6 +7479,8 @@ def group_mean_bin_float32(ndarray[float32_t, ndim=2] out,
74657479 sumx = np.zeros_like(out)
74667480
74677481 N, K = (< object > values).shape
7482+ if len (bins) == 0 :
7483+ return
74687484 if bins[len (bins) - 1 ] == len (values):
74697485 ngroups = len (bins)
74707486 else :
@@ -7520,6 +7536,8 @@ def group_ohlc_float64(ndarray[float64_t, ndim=2] out,
75207536 float64_t vopen, vhigh, vlow, vclose, NA
75217537 bint got_first = 0
75227538
7539+ if len (bins) == 0 :
7540+ return
75237541 if bins[len (bins) - 1 ] == len (values):
75247542 ngroups = len (bins)
75257543 else :
@@ -7594,6 +7612,8 @@ def group_ohlc_float32(ndarray[float32_t, ndim=2] out,
75947612 float32_t vopen, vhigh, vlow, vclose, NA
75957613 bint got_first = 0
75967614
7615+ if len (bins) == 0 :
7616+ return
75977617 if bins[len (bins) - 1 ] == len (values):
75987618 ngroups = len (bins)
75997619 else :
@@ -7801,6 +7821,8 @@ def group_last_bin_float64(ndarray[float64_t, ndim=2] out,
78017821 nobs = np.zeros_like(out)
78027822 resx = np.empty_like(out)
78037823
7824+ if len (bins) == 0 :
7825+ return
78047826 if bins[len (bins) - 1 ] == len (values):
78057827 ngroups = len (bins)
78067828 else :
@@ -7845,6 +7867,8 @@ def group_last_bin_float32(ndarray[float32_t, ndim=2] out,
78457867 nobs = np.zeros_like(out)
78467868 resx = np.empty_like(out)
78477869
7870+ if len (bins) == 0 :
7871+ return
78487872 if bins[len (bins) - 1 ] == len (values):
78497873 ngroups = len (bins)
78507874 else :
@@ -7889,6 +7913,8 @@ def group_last_bin_int64(ndarray[int64_t, ndim=2] out,
78897913 nobs = np.zeros_like(out)
78907914 resx = np.empty_like(out)
78917915
7916+ if len (bins) == 0 :
7917+ return
78927918 if bins[len (bins) - 1 ] == len (values):
78937919 ngroups = len (bins)
78947920 else :
@@ -8067,6 +8093,8 @@ def group_nth_bin_float64(ndarray[float64_t, ndim=2] out,
80678093 nobs = np.zeros_like(out)
80688094 resx = np.empty_like(out)
80698095
8096+ if len (bin) == 0 :
8097+ return
80708098 if bins[len (bins) - 1 ] == len (values):
80718099 ngroups = len (bins)
80728100 else :
@@ -8112,6 +8140,8 @@ def group_nth_bin_float32(ndarray[float32_t, ndim=2] out,
81128140 nobs = np.zeros_like(out)
81138141 resx = np.empty_like(out)
81148142
8143+ if len (bin) == 0 :
8144+ return
81158145 if bins[len (bins) - 1 ] == len (values):
81168146 ngroups = len (bins)
81178147 else :
@@ -8157,6 +8187,8 @@ def group_nth_bin_int64(ndarray[int64_t, ndim=2] out,
81578187 nobs = np.zeros_like(out)
81588188 resx = np.empty_like(out)
81598189
8190+ if len (bin) == 0 :
8191+ return
81608192 if bins[len (bins) - 1 ] == len (values):
81618193 ngroups = len (bins)
81628194 else :
@@ -8386,6 +8418,8 @@ def group_min_bin_float64(ndarray[float64_t, ndim=2] out,
83868418 minx = np.empty_like(out)
83878419 minx.fill(np.inf)
83888420
8421+ if len (bins) == 0 :
8422+ return
83898423 if bins[len (bins) - 1 ] == len (values):
83908424 ngroups = len (bins)
83918425 else :
@@ -8447,6 +8481,8 @@ def group_min_bin_float32(ndarray[float32_t, ndim=2] out,
84478481 minx = np.empty_like(out)
84488482 minx.fill(np.inf)
84498483
8484+ if len (bins) == 0 :
8485+ return
84508486 if bins[len (bins) - 1 ] == len (values):
84518487 ngroups = len (bins)
84528488 else :
@@ -8508,6 +8544,8 @@ def group_min_bin_int64(ndarray[int64_t, ndim=2] out,
85088544 minx = np.empty_like(out)
85098545 minx.fill(9223372036854775807 )
85108546
8547+ if len (bins) == 0 :
8548+ return
85118549 if bins[len (bins) - 1 ] == len (values):
85128550 ngroups = len (bins)
85138551 else :
@@ -8750,6 +8788,8 @@ def group_max_bin_float64(ndarray[float64_t, ndim=2] out,
87508788 maxx = np.empty_like(out)
87518789 maxx.fill(- np.inf)
87528790
8791+ if len (bins) == 0 :
8792+ return
87538793 if bins[len (bins) - 1 ] == len (values):
87548794 ngroups = len (bins)
87558795 else :
@@ -8810,6 +8850,8 @@ def group_max_bin_float32(ndarray[float32_t, ndim=2] out,
88108850 maxx = np.empty_like(out)
88118851 maxx.fill(- np.inf)
88128852
8853+ if len (bins) == 0 :
8854+ return
88138855 if bins[len (bins) - 1 ] == len (values):
88148856 ngroups = len (bins)
88158857 else :
@@ -8870,6 +8912,8 @@ def group_max_bin_int64(ndarray[int64_t, ndim=2] out,
88708912 maxx = np.empty_like(out)
88718913 maxx.fill(- 9223372036854775807 )
88728914
8915+ if len (bins) == 0 :
8916+ return
88738917 if bins[len (bins) - 1 ] == len (values):
88748918 ngroups = len (bins)
88758919 else :
@@ -9110,6 +9154,8 @@ def group_count_bin_float64(ndarray[float64_t, ndim=2] out,
91109154 ndarray[int64_t, ndim= 2 ] nobs = np.zeros((out.shape[0 ], out.shape[1 ]),
91119155 dtype = np.int64)
91129156
9157+ if len (bins) == 0 :
9158+ return
91139159 ngroups = len (bins) + (bins[len (bins) - 1 ] != N)
91149160
91159161 for i in range (N):
@@ -9144,6 +9190,8 @@ def group_count_bin_float32(ndarray[float32_t, ndim=2] out,
91449190 ndarray[int64_t, ndim= 2 ] nobs = np.zeros((out.shape[0 ], out.shape[1 ]),
91459191 dtype = np.int64)
91469192
9193+ if len (bins) == 0 :
9194+ return
91479195 ngroups = len (bins) + (bins[len (bins) - 1 ] != N)
91489196
91499197 for i in range (N):
@@ -9178,6 +9226,8 @@ def group_count_bin_int64(ndarray[int64_t, ndim=2] out,
91789226 ndarray[int64_t, ndim= 2 ] nobs = np.zeros((out.shape[0 ], out.shape[1 ]),
91799227 dtype = np.int64)
91809228
9229+ if len (bins) == 0 :
9230+ return
91819231 ngroups = len (bins) + (bins[len (bins) - 1 ] != N)
91829232
91839233 for i in range (N):
@@ -9212,6 +9262,8 @@ def group_count_bin_object(ndarray[object, ndim=2] out,
92129262 ndarray[int64_t, ndim= 2 ] nobs = np.zeros((out.shape[0 ], out.shape[1 ]),
92139263 dtype = np.int64)
92149264
9265+ if len (bins) == 0 :
9266+ return
92159267 ngroups = len (bins) + (bins[len (bins) - 1 ] != N)
92169268
92179269 for i in range (N):
@@ -9246,6 +9298,8 @@ def group_count_bin_int64(ndarray[int64_t, ndim=2] out,
92469298 ndarray[int64_t, ndim= 2 ] nobs = np.zeros((out.shape[0 ], out.shape[1 ]),
92479299 dtype = np.int64)
92489300
9301+ if len (bins) == 0 :
9302+ return
92499303 ngroups = len (bins) + (bins[len (bins) - 1 ] != N)
92509304
92519305 for i in range (N):
0 commit comments