-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
CLN/STY: Nitpicks #32961
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLN/STY: Nitpicks #32961
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,8 +38,15 @@ cimport pandas._libs.util as util | |
from pandas._libs.util cimport numeric, get_nat | ||
|
||
from pandas._libs.khash cimport ( | ||
khiter_t, kh_destroy_int64, kh_put_int64, kh_init_int64, kh_int64_t, | ||
kh_resize_int64, kh_get_int64) | ||
kh_destroy_int64, | ||
kh_get_int64, | ||
kh_init_int64, | ||
kh_int64_t, | ||
kh_put_int64, | ||
kh_resize_int64, | ||
khiter_t, | ||
) | ||
|
||
|
||
import pandas._libs.missing as missing | ||
|
||
|
@@ -791,8 +798,13 @@ ctypedef fused rank_t: | |
|
||
@cython.wraparound(False) | ||
@cython.boundscheck(False) | ||
def rank_1d(rank_t[:] in_arr, ties_method='average', | ||
ascending=True, na_option='keep', pct=False): | ||
def rank_1d( | ||
rank_t[:] in_arr, | ||
ties_method="average", | ||
bint ascending=True, | ||
na_option="keep", | ||
bint pct=False, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added |
||
): | ||
""" | ||
Fast NaN-friendly version of ``scipy.stats.rankdata``. | ||
""" | ||
|
@@ -1009,8 +1021,14 @@ def rank_1d(rank_t[:] in_arr, ties_method='average', | |
return ranks | ||
|
||
|
||
def rank_2d(rank_t[:, :] in_arr, axis=0, ties_method='average', | ||
ascending=True, na_option='keep', pct=False): | ||
def rank_2d( | ||
rank_t[:, :] in_arr, | ||
int axis=0, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added |
||
ties_method="average", | ||
bint ascending=True, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added |
||
na_option="keep", | ||
bint pct=False, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added |
||
): | ||
""" | ||
Fast NaN-friendly version of ``scipy.stats.rankdata``. | ||
""" | ||
|
@@ -1190,9 +1208,12 @@ ctypedef fused out_t: | |
|
||
@cython.boundscheck(False) | ||
@cython.wraparound(False) | ||
def diff_2d(diff_t[:, :] arr, | ||
out_t[:, :] out, | ||
Py_ssize_t periods, int axis): | ||
def diff_2d( | ||
diff_t[:, :] arr, | ||
out_t[:, :] out, | ||
Py_ssize_t periods, | ||
int axis, | ||
): | ||
cdef: | ||
Py_ssize_t i, j, sx, sy, start, stop | ||
bint f_contig = arr.is_f_contig() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,19 @@ import warnings | |
|
||
import numpy as np | ||
cimport numpy as cnp | ||
from numpy cimport (ndarray, intp_t, | ||
float64_t, float32_t, | ||
int64_t, int32_t, int16_t, int8_t, | ||
uint64_t, uint32_t, uint16_t, uint8_t | ||
from numpy cimport ( | ||
float32_t, | ||
float64_t, | ||
int8_t, | ||
int16_t, | ||
int32_t, | ||
int64_t, | ||
intp_t, | ||
ndarray, | ||
uint8_t, | ||
uint16_t, | ||
uint32_t, | ||
uint64_t, | ||
) | ||
cnp.import_array() | ||
|
||
|
@@ -364,7 +373,7 @@ cdef class ObjectEngine(IndexEngine): | |
|
||
cdef class DatetimeEngine(Int64Engine): | ||
|
||
cdef _get_box_dtype(self): | ||
cdef str _get_box_dtype(self): | ||
return 'M8[ns]' | ||
|
||
cdef int64_t _unbox_scalar(self, scalar) except? -1: | ||
|
@@ -454,7 +463,7 @@ cdef class DatetimeEngine(Int64Engine): | |
|
||
cdef class TimedeltaEngine(DatetimeEngine): | ||
|
||
cdef _get_box_dtype(self): | ||
cdef str _get_box_dtype(self): | ||
return 'm8[ns]' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not gonna change to double-quotes while you're here? |
||
|
||
cdef int64_t _unbox_scalar(self, scalar) except? -1: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
bint