From 886f74337ec9488768a5d98069ce8388cc8d7c57 Mon Sep 17 00:00:00 2001 From: Tuhin Sharma Date: Sun, 9 Feb 2025 09:11:45 +0530 Subject: [PATCH] DOC: fix ES01 for pandas.DataFrame.set_flags and pandas.Series.set_flags --- pandas/core/generic.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index f376518d4d3b8..874ab1a3c944d 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -406,6 +406,12 @@ def set_flags( """ Return a new object with updated flags. + This method creates a shallow copy of the original object, preserving its + underlying data while modifying its global flags. In particular, it allows + you to update properties such as whether duplicate labels are permitted. This + behavior is especially useful in method chains, where one wishes to + adjust DataFrame or Series characteristics without altering the original object. + Parameters ---------- copy : bool, default False