Skip to content
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/index.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ cdef class BaseMultiIndexCodesEngine:
raise KeyError(key)
try:
indices = [1 if checknull(v) else lev.get_loc(v) + multiindex_nulls_shift
for lev, v in zip(self.levels, key)]
for lev, v in zip(self.levels, key, strict=True)]
except KeyError:
raise KeyError(key)

Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/missing.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ cpdef bint check_na_tuples_nonequal(object left, object right):
if len(left) != len(right):
return False

for left_element, right_element in zip(left, right):
for left_element, right_element in zip(left, right, strict=True):
if left_element is C_NA and right_element is not C_NA:
return True
elif right_element is C_NA and left_element is not C_NA:
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/fields.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def month_position_check(fields, weekdays) -> str | None:
int32_t[:] months = fields["M"]
int32_t[:] days = fields["D"]

for y, m, d, wd in zip(years, months, days, weekdays):
for y, m, d, wd in zip(years, months, days, weekdays, strict=True):
if calendar_start:
calendar_start &= d == 1
if business_start:
Expand Down
6 changes: 3 additions & 3 deletions pandas/_libs/tslibs/offsets.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2217,7 +2217,7 @@ cdef class BusinessHour(BusinessMixin):
# Use python string formatting to be faster than strftime
hours = ",".join(
f"{st.hour:02d}:{st.minute:02d}-{en.hour:02d}:{en.minute:02d}"
for st, en in zip(self.start, self.end)
for st, en in zip(self.start, self.end, strict=True)
)
attrs = [f"{self._prefix}={hours}"]
out += ": " + ", ".join(attrs)
Expand Down Expand Up @@ -2414,7 +2414,7 @@ cdef class BusinessHour(BusinessMixin):
# get total business hours by sec in one business day
businesshours = sum(
self._get_business_hours_by_sec(st, en)
for st, en in zip(self.start, self.end)
for st, en in zip(self.start, self.end, strict=True)
)

bd, r = divmod(abs(n * 60), businesshours // 60)
Expand Down Expand Up @@ -5357,7 +5357,7 @@ cpdef to_offset(freq, bint is_period=False):
# the last element must be blank
raise ValueError("last element must be blank")

tups = zip(split[0::4], split[1::4], split[2::4])
tups = zip(split[0::4], split[1::4], split[2::4], strict=False)
for n, (sep, stride, name) in enumerate(tups):
name = _warn_about_deprecated_aliases(name, is_period)
_validate_to_offset_alias(name, is_period)
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/timezones.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ cdef object _get_utc_trans_times_from_dateutil_tz(tzinfo tz):
"""
new_trans = list(tz._trans_list)
last_std_offset = 0
for i, (trans, tti) in enumerate(zip(tz._trans_list, tz._trans_idx)):
for i, (trans, tti) in enumerate(zip(tz._trans_list, tz._trans_idx, strict=True)):
if not tti.isdst:
last_std_offset = tti.offset
new_trans[i] = trans - last_std_offset
Expand Down
4 changes: 2 additions & 2 deletions pandas/util/_doctools.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def plot(
# left
max_left_cols = max(self._shape(df)[1] for df in left)
max_left_rows = max(self._shape(df)[0] for df in left)
for i, (_left, _label) in enumerate(zip(left, labels)):
for i, (_left, _label) in enumerate(zip(left, labels, strict=True)):
ax = fig.add_subplot(gs[i, 0:max_left_cols])
self._make_table(ax, _left, title=_label, height=1.0 / max_left_rows)
# right
Expand All @@ -97,7 +97,7 @@ def plot(
gs = gridspec.GridSpec(1, hcells)
# left
i = 0
for df, _label in zip(left, labels):
for df, _label in zip(left, labels, strict=True):
sp = self._shape(df)
ax = fig.add_subplot(gs[0, i : i + sp[1]])
self._make_table(ax, df, title=_label, height=height)
Expand Down
4 changes: 2 additions & 2 deletions pandas/util/_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def validate_args(fname, args, max_fname_arg_count, compat_args) -> None:
# We do this so that we can provide a more informative
# error message about the parameters that we are not
# supporting in the pandas implementation of 'fname'
kwargs = dict(zip(compat_args, args))
kwargs = dict(zip(compat_args, args, strict=False))
_check_for_default_values(fname, kwargs, compat_args)


Expand Down Expand Up @@ -212,7 +212,7 @@ def validate_args_and_kwargs(

# Check there is no overlap with the positional and keyword
# arguments, similar to what is done in actual Python functions
args_dict = dict(zip(compat_args, args))
args_dict = dict(zip(compat_args, args, strict=False))

for key in args_dict:
if key in kwargs:
Expand Down
Loading