A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.errors.SettingWithCopyError.html below:

pandas.errors.SettingWithCopyError — pandas 2.3.1 documentation

pandas.errors.SettingWithCopyError#
exception pandas.errors.SettingWithCopyError[source]#

Exception raised when trying to set on a copied slice from a DataFrame.

The mode.chained_assignment needs to be set to set to ‘raise.’ This can happen unintentionally when chained indexing.

For more information on evaluation order, see the user guide.

For more information on view vs. copy, see the user guide.

Examples

>>> pd.options.mode.chained_assignment = 'raise'
>>> df = pd.DataFrame({'A': [1, 1, 1, 2, 2]}, columns=['A'])
>>> df.loc[0:3]['A'] = 'a' 
... # SettingWithCopyError: A value is trying to be set on a copy of a...

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4