diff --git a/pandas/io/sas/sas7bdat.py b/pandas/io/sas/sas7bdat.py index 80efef211ece5..fd47396347ff9 100644 --- a/pandas/io/sas/sas7bdat.py +++ b/pandas/io/sas/sas7bdat.py @@ -668,9 +668,7 @@ def read(self, nrows: int | None = None) -> DataFrame: if nrows > 0 and self._current_row_in_file_index >= self.row_count: return DataFrame() - m = self.row_count - self._current_row_in_file_index - if nrows > m: - nrows = m + nrows = min(nrows, self.row_count - self._current_row_in_file_index) nd = self._column_types.count(b"d") ns = self._column_types.count(b"s") diff --git a/pandas/plotting/_matplotlib/converter.py b/pandas/plotting/_matplotlib/converter.py index 28279ff4ee710..4a10311b1f9fa 100644 --- a/pandas/plotting/_matplotlib/converter.py +++ b/pandas/plotting/_matplotlib/converter.py @@ -1109,7 +1109,5 @@ def format_timedelta_ticks(x, pos, n_decimals: int) -> str: def __call__(self, x, pos: int = 0) -> str: (vmin, vmax) = tuple(self.axis.get_view_interval()) - n_decimals = int(np.ceil(np.log10(100 * 10**9 / abs(vmax - vmin)))) - if n_decimals > 9: - n_decimals = 9 + n_decimals = min(int(np.ceil(np.log10(100 * 10**9 / abs(vmax - vmin)))), 9) return self.format_timedelta_ticks(x, pos, n_decimals) diff --git a/pyproject.toml b/pyproject.toml index 18150f8d5220e..29ac4c41369b1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -103,7 +103,6 @@ disable = [ "chained-comparison", "comparison-with-itself", "consider-merging-isinstance", - "consider-using-min-builtin", "consider-using-ternary", "consider-using-with", "cyclic-import",