Skip to content

Commit 7bf263b

Browse files
committed
2.6 compatibility
1 parent 69fd10e commit 7bf263b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pandas/core/generic.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -1282,22 +1282,21 @@ def _check_setitem_copy(self, stacklevel=4, t='setting', force=False):
12821282
# a custom message
12831283
if isinstance(self.is_copy, string_types):
12841284
t = self.is_copy
1285-
12861285
elif t == 'referant':
12871286
t = ("\n"
12881287
"A value is trying to be set on a copy of a slice from a "
1289-
"{}\n\n"
1288+
"{name}\n\n"
12901289
"See the the caveats in the documentation: "
12911290
"http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy")
1292-
1291+
t = t.format(name=type(self).__name__)
12931292
else:
12941293
t = ("\n"
12951294
"A value is trying to be set on a copy of a slice from a "
1296-
"{}.\n"
1295+
"{name}.\n"
12971296
"Try using .loc[row_indexer,col_indexer] = value instead\n\n"
12981297
"See the the caveats in the documentation: "
12991298
"http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy")
1300-
t = t.format(type(self).__name__)
1299+
t = t.format(name=type(self).__name__)
13011300
if value == 'raise':
13021301
raise SettingWithCopyError(t)
13031302
elif value == 'warn':

0 commit comments

Comments
 (0)