Skip to content

Commit 1dffd7b

Browse files
committed
2.6 compatibility
1 parent 69fd10e commit 1dffd7b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pandas/core/generic.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -1286,23 +1286,25 @@ def _check_setitem_copy(self, stacklevel=4, t='setting', force=False):
12861286
elif t == 'referant':
12871287
t = ("\n"
12881288
"A value is trying to be set on a copy of a slice from a "
1289-
"{}\n\n"
1289+
"{name}\n\n"
12901290
"See the the caveats in the documentation: "
12911291
"http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy")
12921292

12931293
else:
12941294
t = ("\n"
12951295
"A value is trying to be set on a copy of a slice from a "
1296-
"{}.\n"
1296+
"{name}.\n"
12971297
"Try using .loc[row_indexer,col_indexer] = value instead\n\n"
12981298
"See the the caveats in the documentation: "
12991299
"http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy")
1300-
t = t.format(type(self).__name__)
1300+
1301+
t = t.format(name=type(self).__name__)
1302+
13011303
if value == 'raise':
13021304
raise SettingWithCopyError(t)
13031305
elif value == 'warn':
13041306
warnings.warn(t, SettingWithCopyWarning, stacklevel=stacklevel)
1305-
1307+
13061308
def __delitem__(self, key):
13071309
"""
13081310
Delete item

0 commit comments

Comments
 (0)