Skip to content

Commit 1f3dce4

Browse files
committed
DOC: Fix docstrings for errors
1 parent 8a286fa commit 1f3dce4

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

ci/code_checks.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
9595
-i "pandas.core.resample.Resampler.std SA01" \
9696
-i "pandas.core.resample.Resampler.transform PR01,RT03,SA01" \
9797
-i "pandas.core.resample.Resampler.var SA01" \
98-
-i "pandas.errors.NullFrequencyError SA01" \
99-
-i "pandas.errors.NumbaUtilError SA01" \
100-
-i "pandas.errors.PerformanceWarning SA01" \
10198
-i "pandas.errors.UndefinedVariableError PR01,SA01" \
10299
-i "pandas.errors.ValueLabelTypeMismatch SA01" \
103100
-i "pandas.io.json.build_table_schema PR07,RT03,SA01" \

pandas/errors/__init__.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ class NullFrequencyError(ValueError):
4545
Particularly ``DatetimeIndex.shift``, ``TimedeltaIndex.shift``,
4646
``PeriodIndex.shift``.
4747
48+
See Also
49+
--------
50+
Index.shift : Shift values of Index.
51+
Series.shift : Shift values of Series.
52+
4853
Examples
4954
--------
5055
>>> df = pd.DatetimeIndex(["2011-01-01 10:00", "2011-01-01"], freq=None)
@@ -58,6 +63,12 @@ class PerformanceWarning(Warning):
5863
"""
5964
Warning raised when there is a possible performance impact.
6065
66+
See Also
67+
--------
68+
DataFrame.set_index : Set the DataFrame index using existing columns.
69+
DataFrame.loc : Access a group of rows and columns by label(s) \
70+
or a boolean array.
71+
6172
Examples
6273
--------
6374
>>> df = pd.DataFrame(
@@ -385,17 +396,24 @@ class NumbaUtilError(Exception):
385396
"""
386397
Error raised for unsupported Numba engine routines.
387398
399+
See Also
400+
--------
401+
DataFrame.groupby : Group DataFrame using a mapper or by a Series of columns.
402+
Series.groupby : Group Series using a mapper or by a Series of columns.
403+
DataFrame.agg : Aggregate using one or more operations over the specified axis.
404+
Series.agg : Aggregate using one or more operations over the specified axis.
405+
388406
Examples
389407
--------
390408
>>> df = pd.DataFrame(
391409
... {"key": ["a", "a", "b", "b"], "data": [1, 2, 3, 4]}, columns=["key", "data"]
392410
... )
393411
>>> def incorrect_function(x):
394412
... return sum(x) * 2.7
395-
>>> df.groupby("key").agg(incorrect_function, engine="numba")
413+
>>> df.("key").agg(incorrect_function, engine="numba")
396414
Traceback (most recent call last):
397415
NumbaUtilError: The first 2 arguments to incorrect_function
398-
must be ['values', 'index']
416+
must be ['values', 'index']groupby
399417
"""
400418

401419

0 commit comments

Comments
 (0)