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" \ 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 --------