Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K

pandas.errors.SettingWithCopyError#

exceptionpandas.errors.SettingWithCopyError[source]#

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

Themode.chained_assignment needs to be set to set to ‘raise.’ This canhappen unintentionally when chained indexing.

For more information on evaluation order,seethe user guide.

For more information on view vs. copy,seethe 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...

[8]ページ先頭

©2009-2025 Movatter.jp