Skip to content

CLN: rename confusing variable name #51690

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pandas/_libs/algos.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ def is_monotonic(ndarray[numeric_object_t, ndim=1] arr, bint timelike):
tuple
is_monotonic_inc : bool
is_monotonic_dec : bool
is_unique : bool
is_strict_monotonic : bool
"""
cdef:
Py_ssize_t i, n
Expand Down
10 changes: 5 additions & 5 deletions pandas/_libs/index.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -256,24 +256,24 @@ cdef class IndexEngine:

cdef _do_monotonic_check(self):
cdef:
bint is_unique
bint is_strict_monotonic
if self.mask is not None and np.any(self.mask):
self.monotonic_inc = 0
self.monotonic_dec = 0
else:
try:
values = self.values
self.monotonic_inc, self.monotonic_dec, is_unique = \
self.monotonic_inc, self.monotonic_dec, is_strict_monotonic = \
self._call_monotonic(values)
except TypeError:
self.monotonic_inc = 0
self.monotonic_dec = 0
is_unique = 0
is_strict_monotonic = 0

self.need_monotonic_check = 0

# we can only be sure of uniqueness if is_unique=1
if is_unique:
# we can only be sure of uniqueness if is_strict_monotonic=1
if is_strict_monotonic:
self.unique = 1
self.need_unique_check = 0

Expand Down