Skip to content

Commit 42dceac

Browse files
committed
Cleaned up kwargs passing to Cython layer
1 parent 7666354 commit 42dceac

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

pandas/_libs/groupby_helper.pxi.in

+5-8
Original file line numberDiff line numberDiff line change
@@ -907,16 +907,14 @@ def group_cumsum(numeric[:, :] out,
907907
@cython.boundscheck(False)
908908
@cython.wraparound(False)
909909
def group_shift_indexer(ndarray[int64_t] out, ndarray[int64_t] labels,
910-
int64_t ngroups, **kwargs):
910+
int64_t ngroups, int64_t periods):
911911
cdef:
912912
Py_ssize_t N, i, j, ii
913-
int offset, sign, periods
913+
int offset, sign
914914
int64_t lab, idxer, idxer_slot
915915
int64_t[:] label_seen = np.zeros(ngroups, dtype=np.int64)
916916
int64_t[:, :] label_indexer
917917

918-
periods = kwargs['periods']
919-
920918
N, = (<object> labels).shape
921919

922920
if periods < 0:
@@ -960,7 +958,8 @@ def group_shift_indexer(ndarray[int64_t] out, ndarray[int64_t] labels,
960958
@cython.wraparound(False)
961959
@cython.boundscheck(False)
962960
def group_fillna_indexer(ndarray[int64_t] out, ndarray[int64_t] labels,
963-
ndarray[uint8_t] mask, **kwargs):
961+
ndarray[uint8_t] mask, object direction,
962+
int64_t limit):
964963
"""Indexes how to fill values forwards or backwards within a group
965964

966965
Parameters
@@ -981,10 +980,8 @@ def group_fillna_indexer(ndarray[int64_t] out, ndarray[int64_t] labels,
981980
cdef:
982981
Py_ssize_t i, N
983982
ndarray[int64_t] sorted_labels
984-
int64_t limit, idx, curr_fill_idx=-1, filled_vals=0
983+
int64_t idx, curr_fill_idx=-1, filled_vals=0
985984

986-
direction = kwargs['direction']
987-
limit = kwargs['limit']
988985
N = len(out)
989986

990987
# Make sure all arrays are the same size

0 commit comments

Comments
 (0)