From 691abba1ee2d28ec0a0a0fb4ab6fb5b26d537488 Mon Sep 17 00:00:00 2001 From: Xiao Yuan Date: Mon, 15 Jan 2024 14:34:27 +0800 Subject: [PATCH] DOC: fix EX03 in `pandas.errors` (#56867) --- ci/code_checks.sh | 4 ---- pandas/errors/__init__.py | 10 +++++----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 8658715b8bf3e..afb76c29133f9 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -76,13 +76,9 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then pandas.errors.DatabaseError \ pandas.errors.IndexingError \ pandas.errors.InvalidColumnName \ - pandas.errors.PossibleDataLossError \ - pandas.errors.PossiblePrecisionLoss \ - pandas.errors.SettingWithCopyError \ pandas.errors.SettingWithCopyWarning \ pandas.errors.SpecificationError \ pandas.errors.UndefinedVariableError \ - pandas.errors.ValueLabelTypeMismatch \ pandas.Timestamp.ceil \ pandas.Timestamp.floor \ pandas.Timestamp.round \ diff --git a/pandas/errors/__init__.py b/pandas/errors/__init__.py index 9faa17f6e5f15..9d39b8d92fec9 100644 --- a/pandas/errors/__init__.py +++ b/pandas/errors/__init__.py @@ -425,7 +425,7 @@ class SettingWithCopyError(ValueError): -------- >>> pd.options.mode.chained_assignment = 'raise' >>> df = pd.DataFrame({'A': [1, 1, 1, 2, 2]}, columns=['A']) - >>> df.loc[0:3]['A'] = 'a' # doctest: +SKIP + >>> df.loc[0:3]['A'] = 'a' # doctest: +SKIP ... # SettingWithCopyError: A value is trying to be set on a copy of a... """ @@ -665,8 +665,8 @@ class PossibleDataLossError(Exception): Examples -------- - >>> store = pd.HDFStore('my-store', 'a') # doctest: +SKIP - >>> store.open("w") # doctest: +SKIP + >>> store = pd.HDFStore('my-store', 'a') # doctest: +SKIP + >>> store.open("w") # doctest: +SKIP ... # PossibleDataLossError: Re-opening the file [my-store] with mode [a]... """ @@ -734,7 +734,7 @@ class PossiblePrecisionLoss(Warning): Examples -------- >>> df = pd.DataFrame({"s": pd.Series([1, 2**53], dtype=np.int64)}) - >>> df.to_stata('test') # doctest: +SKIP + >>> df.to_stata('test') # doctest: +SKIP ... # PossiblePrecisionLoss: Column converted from int64 to float64... """ @@ -746,7 +746,7 @@ class ValueLabelTypeMismatch(Warning): Examples -------- >>> df = pd.DataFrame({"categories": pd.Series(["a", 2], dtype="category")}) - >>> df.to_stata('test') # doctest: +SKIP + >>> df.to_stata('test') # doctest: +SKIP ... # ValueLabelTypeMismatch: Stata value labels (pandas categories) must be str... """