@@ -7930,192 +7930,6 @@ def group_max_int64(ndarray[int64_t, ndim=2] out,
79307930 out[i, j] = maxx[i, j]
79317931
79327932
7933- @ cython.boundscheck (False )
7934- @ cython.wraparound (False )
7935- def group_count_float64 (ndarray[float64_t , ndim = 2 ] out,
7936- ndarray[int64_t] counts ,
7937- ndarray[float64_t , ndim = 2 ] values,
7938- ndarray[int64_t] labels ):
7939- '''
7940- Only aggregates on axis=0
7941- '''
7942- cdef:
7943- Py_ssize_t i, j, lab, ncounts = len (counts)
7944- Py_ssize_t N = values.shape[0 ], K = values.shape[1 ]
7945- float64_t val
7946- ndarray[int64_t, ndim= 2 ] nobs = np.zeros((out.shape[0 ], out.shape[1 ]),
7947- dtype = np.int64)
7948-
7949- if len (values) != len (labels):
7950- raise AssertionError (" len(index) != len(labels)" )
7951-
7952-
7953- with nogil:
7954- for i in range (N):
7955- lab = labels[i]
7956- if lab < 0 :
7957- continue
7958-
7959- counts[lab] += 1
7960- for j in range (K):
7961- val = values[i, j]
7962-
7963- # not nan
7964- nobs[lab, j] += val == val and val != iNaT
7965-
7966- for i in range (ncounts):
7967- for j in range (K):
7968- out[i, j] = nobs[i, j]
7969-
7970- @ cython.boundscheck (False )
7971- @ cython.wraparound (False )
7972- def group_count_float32 (ndarray[float32_t , ndim = 2 ] out,
7973- ndarray[int64_t] counts ,
7974- ndarray[float32_t , ndim = 2 ] values,
7975- ndarray[int64_t] labels ):
7976- '''
7977- Only aggregates on axis=0
7978- '''
7979- cdef:
7980- Py_ssize_t i, j, lab, ncounts = len (counts)
7981- Py_ssize_t N = values.shape[0 ], K = values.shape[1 ]
7982- float32_t val
7983- ndarray[int64_t, ndim= 2 ] nobs = np.zeros((out.shape[0 ], out.shape[1 ]),
7984- dtype = np.int64)
7985-
7986- if len (values) != len (labels):
7987- raise AssertionError (" len(index) != len(labels)" )
7988-
7989-
7990- with nogil:
7991- for i in range (N):
7992- lab = labels[i]
7993- if lab < 0 :
7994- continue
7995-
7996- counts[lab] += 1
7997- for j in range (K):
7998- val = values[i, j]
7999-
8000- # not nan
8001- nobs[lab, j] += val == val and val != iNaT
8002-
8003- for i in range (ncounts):
8004- for j in range (K):
8005- out[i, j] = nobs[i, j]
8006-
8007- @ cython.boundscheck (False )
8008- @ cython.wraparound (False )
8009- def group_count_int64 (ndarray[int64_t , ndim = 2 ] out,
8010- ndarray[int64_t] counts ,
8011- ndarray[int64_t , ndim = 2 ] values,
8012- ndarray[int64_t] labels ):
8013- '''
8014- Only aggregates on axis=0
8015- '''
8016- cdef:
8017- Py_ssize_t i, j, lab, ncounts = len (counts)
8018- Py_ssize_t N = values.shape[0 ], K = values.shape[1 ]
8019- int64_t val
8020- ndarray[int64_t, ndim= 2 ] nobs = np.zeros((out.shape[0 ], out.shape[1 ]),
8021- dtype = np.int64)
8022-
8023- if len (values) != len (labels):
8024- raise AssertionError (" len(index) != len(labels)" )
8025-
8026-
8027- with nogil:
8028- for i in range (N):
8029- lab = labels[i]
8030- if lab < 0 :
8031- continue
8032-
8033- counts[lab] += 1
8034- for j in range (K):
8035- val = values[i, j]
8036-
8037- # not nan
8038- nobs[lab, j] += val == val and val != iNaT
8039-
8040- for i in range (ncounts):
8041- for j in range (K):
8042- out[i, j] = nobs[i, j]
8043-
8044- @ cython.boundscheck (False )
8045- @ cython.wraparound (False )
8046- def group_count_object (ndarray[object , ndim = 2 ] out,
8047- ndarray[int64_t] counts ,
8048- ndarray[object , ndim = 2 ] values,
8049- ndarray[int64_t] labels ):
8050- '''
8051- Only aggregates on axis=0
8052- '''
8053- cdef:
8054- Py_ssize_t i, j, lab, ncounts = len (counts)
8055- Py_ssize_t N = values.shape[0 ], K = values.shape[1 ]
8056- object val
8057- ndarray[int64_t, ndim= 2 ] nobs = np.zeros((out.shape[0 ], out.shape[1 ]),
8058- dtype = np.int64)
8059-
8060- if len (values) != len (labels):
8061- raise AssertionError (" len(index) != len(labels)" )
8062-
8063-
8064-
8065- for i in range (N):
8066- lab = labels[i]
8067- if lab < 0 :
8068- continue
8069-
8070- counts[lab] += 1
8071- for j in range (K):
8072- val = values[i, j]
8073-
8074- # not nan
8075- nobs[lab, j] += val == val and val != iNaT
8076-
8077- for i in range (ncounts):
8078- for j in range (K):
8079- out[i, j] = nobs[i, j]
8080-
8081- @ cython.boundscheck (False )
8082- @ cython.wraparound (False )
8083- def group_count_int64 (ndarray[int64_t , ndim = 2 ] out,
8084- ndarray[int64_t] counts ,
8085- ndarray[int64_t , ndim = 2 ] values,
8086- ndarray[int64_t] labels ):
8087- '''
8088- Only aggregates on axis=0
8089- '''
8090- cdef:
8091- Py_ssize_t i, j, lab, ncounts = len (counts)
8092- Py_ssize_t N = values.shape[0 ], K = values.shape[1 ]
8093- int64_t val
8094- ndarray[int64_t, ndim= 2 ] nobs = np.zeros((out.shape[0 ], out.shape[1 ]),
8095- dtype = np.int64)
8096-
8097- if len (values) != len (labels):
8098- raise AssertionError (" len(index) != len(labels)" )
8099-
8100-
8101- with nogil:
8102- for i in range (N):
8103- lab = labels[i]
8104- if lab < 0 :
8105- continue
8106-
8107- counts[lab] += 1
8108- for j in range (K):
8109- val = values[i, j]
8110-
8111- # not nan
8112- nobs[lab, j] += val == val and val != iNaT
8113-
8114- for i in range (ncounts):
8115- for j in range (K):
8116- out[i, j] = nobs[i, j]
8117-
8118-
81197933@ cython.wraparound (False )
81207934@ cython.boundscheck (False )
81217935def left_join_indexer_unique_float64 (ndarray[float64_t] left ,
0 commit comments