pandas.Series.attrs
- propertySeries.attrs[source]
-
Dictionary of global attributes of this dataset.
Warning
attrs is experimental and may change without warning.
See also
DataFrame.flags
-
Global flags applying to this object.
Notes
Many operations that create new datasets will copy
attrs
. Copies are always deep so that changingattrs
will only affect the present dataset.pandas.concat
copiesattrs
only if all input datasets have the sameattrs
.Examples
For Series:
>>> ser = pd.Series([1, 2, 3]) >>> ser.attrs = {"A": [10, 20, 30]} >>> ser.attrs {'A': [10, 20, 30]}
For DataFrame:
>>> df = pd.DataFrame({'A': [1, 2], 'B': [3, 4]}) >>> df.attrs = {"A": [10, 20, 30]} >>> df.attrs {'A': [10, 20, 30]}
© 2008–2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
© 2011–2025, Open source contributors
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/2.3.0/reference/api/pandas.Series.attrs.html