Skip to content

Commit da436a7

Browse files
authored
Merge branch 'main' into dependabot/github_actions/pypa/cibuildwheel-2.22.0
2 parents dbce169 + 0b6cece commit da436a7

File tree

7 files changed

+62
-11
lines changed

7 files changed

+62
-11
lines changed

ci/code_checks.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,11 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
109109
-i "pandas.core.resample.Resampler.std SA01" \
110110
-i "pandas.core.resample.Resampler.transform PR01,RT03,SA01" \
111111
-i "pandas.core.resample.Resampler.var SA01" \
112-
-i "pandas.errors.DuplicateLabelError SA01" \
113112
-i "pandas.errors.IntCastingNaNError SA01" \
114-
-i "pandas.errors.InvalidIndexError SA01" \
115113
-i "pandas.errors.NullFrequencyError SA01" \
116-
-i "pandas.errors.NumExprClobberingError SA01" \
117114
-i "pandas.errors.NumbaUtilError SA01" \
118-
-i "pandas.errors.OutOfBoundsTimedelta SA01" \
119115
-i "pandas.errors.PerformanceWarning SA01" \
120-
-i "pandas.errors.PossibleDataLossError SA01" \
121116
-i "pandas.errors.UndefinedVariableError PR01,SA01" \
122-
-i "pandas.errors.UnsortedIndexError SA01" \
123117
-i "pandas.errors.ValueLabelTypeMismatch SA01" \
124118
-i "pandas.infer_freq SA01" \
125119
-i "pandas.io.json.build_table_schema PR07,RT03,SA01" \

doc/source/user_guide/window.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -567,9 +567,9 @@ One must have :math:`0 < \alpha \leq 1`, and while it is possible to pass
567567
568568
\alpha =
569569
\begin{cases}
570-
\frac{2}{s + 1}, & \text{for span}\ s \geq 1\\
571-
\frac{1}{1 + c}, & \text{for center of mass}\ c \geq 0\\
572-
1 - \exp^{\frac{\log 0.5}{h}}, & \text{for half-life}\ h > 0
570+
\frac{2}{s + 1}, & \text{for span}\ s \geq 1\\
571+
\frac{1}{1 + c}, & \text{for center of mass}\ c \geq 0\\
572+
1 - e^{\frac{\log 0.5}{h}}, & \text{for half-life}\ h > 0
573573
\end{cases}
574574
575575
One must specify precisely one of **span**, **center of mass**, **half-life**

pandas/_libs/tslibs/np_datetime.pyx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,10 @@ class OutOfBoundsTimedelta(ValueError):
201201
202202
Representation should be within a timedelta64[ns].
203203
204+
See Also
205+
--------
206+
date_range : Return a fixed frequency DatetimeIndex.
207+
204208
Examples
205209
--------
206210
>>> pd.date_range(start="1/1/1700", freq="B", periods=100000)

pandas/core/arrays/interval.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,9 @@ def shift(self, periods: int = 1, fill_value: object = None) -> IntervalArray:
10551055
from pandas import Index
10561056

10571057
fill_value = Index(self._left, copy=False)._na_value
1058-
empty = IntervalArray.from_breaks([fill_value] * (empty_len + 1))
1058+
empty = IntervalArray.from_breaks(
1059+
[fill_value] * (empty_len + 1), closed=self.closed
1060+
)
10591061
else:
10601062
empty = self._from_sequence([fill_value] * empty_len, dtype=self.dtype)
10611063

pandas/errors/__init__.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ class UnsortedIndexError(KeyError):
100100
101101
Subclass of `KeyError`.
102102
103+
See Also
104+
--------
105+
DataFrame.sort_index : Sort a DataFrame by its index.
106+
DataFrame.set_index : Set the DataFrame index using existing columns.
107+
103108
Examples
104109
--------
105110
>>> df = pd.DataFrame(
@@ -388,6 +393,19 @@ class DuplicateLabelError(ValueError):
388393
"""
389394
Error raised when an operation would introduce duplicate labels.
390395
396+
This error is typically encountered when performing operations on objects
397+
with `allows_duplicate_labels=False` and the operation would result in
398+
duplicate labels in the index. Duplicate labels can lead to ambiguities
399+
in indexing and reduce data integrity.
400+
401+
See Also
402+
--------
403+
Series.set_flags : Return a new ``Series`` object with updated flags.
404+
DataFrame.set_flags : Return a new ``DataFrame`` object with updated flags.
405+
Series.reindex : Conform ``Series`` object to new index with optional filling logic.
406+
DataFrame.reindex : Conform ``DataFrame`` object to new index with optional filling
407+
logic.
408+
391409
Examples
392410
--------
393411
>>> s = pd.Series([0, 1, 2], index=["a", "b", "c"]).set_flags(
@@ -407,6 +425,16 @@ class InvalidIndexError(Exception):
407425
"""
408426
Exception raised when attempting to use an invalid index key.
409427
428+
This exception is triggered when a user attempts to access or manipulate
429+
data in a pandas DataFrame or Series using an index key that is not valid
430+
for the given object. This may occur in cases such as using a malformed
431+
slice, a mismatched key for a ``MultiIndex``, or attempting to access an index
432+
element that does not exist.
433+
434+
See Also
435+
--------
436+
MultiIndex : A multi-level, or hierarchical, index object for pandas objects.
437+
410438
Examples
411439
--------
412440
>>> idx = pd.MultiIndex.from_product([["x", "y"], [0, 1]])
@@ -510,6 +538,11 @@ class NumExprClobberingError(NameError):
510538
to 'numexpr'. 'numexpr' is the default engine value for these methods if the
511539
numexpr package is installed.
512540
541+
See Also
542+
--------
543+
eval : Evaluate a Python expression as a string using various backends.
544+
DataFrame.query : Query the columns of a DataFrame with a boolean expression.
545+
513546
Examples
514547
--------
515548
>>> df = pd.DataFrame({"abs": [1, 1, 1]})
@@ -633,6 +666,15 @@ class PossibleDataLossError(Exception):
633666
"""
634667
Exception raised when trying to open a HDFStore file when already opened.
635668
669+
This error is triggered when there is a potential risk of data loss due to
670+
conflicting operations on an HDFStore file. It serves to prevent unintended
671+
overwrites or data corruption by enforcing exclusive access to the file.
672+
673+
See Also
674+
--------
675+
HDFStore : Dict-like IO interface for storing pandas objects in PyTables.
676+
HDFStore.open : Open an HDFStore file in the specified mode.
677+
636678
Examples
637679
--------
638680
>>> store = pd.HDFStore("my-store", "a") # doctest: +SKIP

pandas/tests/frame/methods/test_shift.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,3 +757,12 @@ def test_shift_with_offsets_freq_empty(self):
757757
df_shifted = DataFrame(index=shifted_dates)
758758
result = df.shift(freq=offset)
759759
tm.assert_frame_equal(result, df_shifted)
760+
761+
def test_series_shift_interval_preserves_closed(self):
762+
# GH#60389
763+
ser = Series(
764+
[pd.Interval(1, 2, closed="right"), pd.Interval(2, 3, closed="right")]
765+
)
766+
result = ser.shift(1)
767+
expected = Series([np.nan, pd.Interval(1, 2, closed="right")])
768+
tm.assert_series_equal(result, expected)

pandas/tests/test_algos.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1254,7 +1254,7 @@ def test_value_counts_nat(self):
12541254
result_dt = algos.value_counts_internal(dt)
12551255
tm.assert_series_equal(result_dt, exp_dt)
12561256

1257-
exp_td = Series({np.timedelta64(10000): 1}, name="count")
1257+
exp_td = Series([1], index=[np.timedelta64(10000)], name="count")
12581258
result_td = algos.value_counts_internal(td)
12591259
tm.assert_series_equal(result_td, exp_td)
12601260

0 commit comments

Comments
 (0)