From 9be426d16692f62f0c8cbf3efd0cfd3b8db54f06 Mon Sep 17 00:00:00 2001 From: tuhinsharma121 Date: Mon, 13 May 2024 19:29:47 +0530 Subject: [PATCH 1/2] DOC: add RT03,SA01 for pandas.api.extensions.ExtensionArray.copy --- pandas/core/arrays/base.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pandas/core/arrays/base.py b/pandas/core/arrays/base.py index 380d2516a44ed..bd5f3232dee82 100644 --- a/pandas/core/arrays/base.py +++ b/pandas/core/arrays/base.py @@ -1604,9 +1604,19 @@ def copy(self) -> Self: """ Return a copy of the array. + This method creates a copy of the `ExtensionArray` where modifying the + data in the copy will not affect the original array. This is useful when + you want to manipulate data without altering the original dataset. + Returns ------- ExtensionArray + A new `ExtensionArray` object that is a copy of the current instance. + + See Also + -------- + DataFrame.copy : Return a copy of the DataFrame. + Series.copy : Return a copy of the Series. Examples -------- From 2e9a970123d70d621f2e07aa6bb30888c1773525 Mon Sep 17 00:00:00 2001 From: tuhinsharma121 Date: Mon, 13 May 2024 19:30:04 +0530 Subject: [PATCH 2/2] DOC: remove RT03,SA01 for pandas.api.extensions.ExtensionArray.copy --- ci/code_checks.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 24321f8ef54f7..ba011d5041cec 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -324,7 +324,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.api.extensions.ExtensionArray._reduce RT03,SA01" \ -i "pandas.api.extensions.ExtensionArray._values_for_factorize SA01" \ -i "pandas.api.extensions.ExtensionArray.astype SA01" \ - -i "pandas.api.extensions.ExtensionArray.copy RT03,SA01" \ -i "pandas.api.extensions.ExtensionArray.dropna RT03,SA01" \ -i "pandas.api.extensions.ExtensionArray.dtype SA01" \ -i "pandas.api.extensions.ExtensionArray.duplicated RT03,SA01" \