@@ -78,15 +78,15 @@ class NDFrame(PandasObject):
7878 axes : list
7979 copy : boolean, default False
8080 """
81- _internal_names = ['_data' , '_cacher' , '_item_cache' , '_cache' ,
82- 'is_copy' , ' _subtyp' , '_index' , '_allow_copy_on_write ' ,
81+ _internal_names = ['_data' , '_cacher' , '_item_cache' , '_cache' , '_parent' ,
82+ '_subtyp' , '_index' , '_parent_copy_on_write ' ,
8383 '_default_kind' , '_default_fill_value' , '_metadata' ,
8484 '__array_struct__' , '__array_interface__' ]
8585 _internal_names_set = set (_internal_names )
8686 _accessors = frozenset ([])
8787 _metadata = []
88- _allow_copy_on_write = True
89- is_copy = None
88+ _parent_copy_on_write = True
89+ _parent = None
9090
9191 def __init__ (self , data , axes = None , copy = False , dtype = None ,
9292 fastpath = False ):
@@ -101,10 +101,22 @@ def __init__(self, data, axes=None, copy=False, dtype=None,
101101 for i , ax in enumerate (axes ):
102102 data = data .reindex_axis (ax , axis = i )
103103
104- object .__setattr__ (self , 'is_copy ' , None )
104+ object .__setattr__ (self , '_parent ' , None )
105105 object .__setattr__ (self , '_data' , data )
106106 object .__setattr__ (self , '_item_cache' , {})
107107
108+ def _get_is_copy (self ):
109+ warnings .warn ("is_copy is deprecated will be removed in a future release" ,
110+ FutureWarning )
111+ return None
112+
113+ def _set_is_copy (self , v ):
114+ warnings .warn ("is_copy is deprecated will be removed in a future release" ,
115+ FutureWarning )
116+ pass
117+
118+ is_copy = property (fget = _get_is_copy , fset = _set_is_copy )
119+
108120 def _validate_dtype (self , dtype ):
109121 """ validate the passed dtype """
110122
@@ -1092,7 +1104,7 @@ def _get_item_cache(self, item):
10921104 res ._set_as_cached (item , self )
10931105
10941106 # for a chain
1095- res .is_copy = self .is_copy
1107+ res ._parent = self ._parent
10961108 return res
10971109
10981110 def _set_as_cached (self , item , cacher ):
@@ -1144,7 +1156,7 @@ def _is_view(self):
11441156 """ boolean : return if I am a view of another array """
11451157 return self ._data .is_view
11461158
1147- def _maybe_update_cacher (self , clear = False , verify_is_copy = True ):
1159+ def _maybe_update_cacher (self , clear = False , verify_parent = True ):
11481160 """
11491161
11501162 see if we need to update our parent cacher
@@ -1154,8 +1166,8 @@ def _maybe_update_cacher(self, clear=False, verify_is_copy=True):
11541166 ----------
11551167 clear : boolean, default False
11561168 clear the item cache
1157- verify_is_copy : boolean, default True
1158- provide is_copy checks
1169+ verify_parent : boolean, default True
1170+ provide parent checks
11591171
11601172 """
11611173
@@ -1173,7 +1185,7 @@ def _maybe_update_cacher(self, clear=False, verify_is_copy=True):
11731185 except :
11741186 pass
11751187
1176- if verify_is_copy :
1188+ if verify_parent :
11771189 self ._check_copy_on_write ()
11781190
11791191 if clear :
@@ -1197,8 +1209,8 @@ def _slice(self, slobj, axis=0, kind=None):
11971209 result = result .__finalize__ (self )
11981210
11991211 # mark this as a copy if we are not axis=0
1200- is_copy = axis != 0
1201- result ._set_is_copy (self )
1212+ parent = axis != 0
1213+ result ._set_parent (self )
12021214 return result
12031215
12041216 def _set_item (self , key , value ):
@@ -1207,23 +1219,23 @@ def _set_item(self, key, value):
12071219 self ._data .set (key , value )
12081220 self ._clear_item_cache ()
12091221
1210- def _set_is_copy (self , ref = None , copy = True ):
1222+ def _set_parent (self , ref = None , copy = True ):
12111223 if not copy :
1212- self .is_copy = None
1224+ self ._parent = None
12131225 else :
12141226 if ref is not None :
1215- self .is_copy = weakref .ref (ref )
1227+ self ._parent = weakref .ref (ref )
12161228 else :
1217- self .is_copy = None
1229+ self ._parent = None
12181230
12191231 def _check_copy_on_write (self ):
12201232
12211233 # we could have a copy-on-write scenario
1222- if self .is_copy and self ._allow_copy_on_write :
1234+ if self ._parent and self ._parent_copy_on_write :
12231235
12241236 # we have an exception
1225- if isinstance (self .is_copy , Exception ):
1226- raise self .is_copy
1237+ if isinstance (self ._parent , Exception ):
1238+ raise self ._parent
12271239
12281240 def get_names_for_obj (__really_unused_name__342424__ ):
12291241 """Returns all named references for self"""
@@ -1255,14 +1267,14 @@ def get_names_for_obj(__really_unused_name__342424__):
12551267
12561268 # otherwise we have chained indexing, raise and error
12571269 gc .collect (2 )
1258- if self .is_copy () is not None :
1270+ if self ._parent () is not None :
12591271 names = get_names_for_obj (self )
12601272 if not len (names ):
12611273 raise SettingWithCopyError ("chained indexing detected, you can fix this ......" )
12621274
12631275 # provide copy-on-write
12641276 self ._data = self ._data .copy ()
1265- self .is_copy = None
1277+ self ._parent = None
12661278
12671279 def _check_is_chained_assignment_possible (self ):
12681280 """
@@ -1279,7 +1291,7 @@ def _check_is_chained_assignment_possible(self):
12791291 if ref is not None :
12801292 self ._check_copy_on_write ()
12811293 return True
1282- elif self .is_copy :
1294+ elif self ._parent :
12831295 self ._check_copy_on_write ()
12841296 return False
12851297
@@ -1342,7 +1354,7 @@ def take(self, indices, axis=0, convert=True, is_copy=True):
13421354 # maybe set copy if we didn't actually change the index
13431355 if is_copy :
13441356 if not result ._get_axis (axis ).equals (self ._get_axis (axis )):
1345- result ._set_is_copy (self )
1357+ result ._set_parent (self )
13461358
13471359 return result
13481360
@@ -1485,7 +1497,7 @@ def xs(self, key, axis=0, level=None, copy=None, drop_level=True):
14851497 result = self .iloc [loc ]
14861498 result .index = new_index
14871499
1488- result ._set_is_copy (self )
1500+ result ._set_parent (self )
14891501 return result
14901502
14911503 _xs = xs
@@ -1608,14 +1620,14 @@ def drop(self, labels, axis=0, level=None, inplace=False, errors='raise'):
16081620 else :
16091621 return result
16101622
1611- def _update_inplace (self , result , verify_is_copy = True ):
1623+ def _update_inplace (self , result , verify_parent = True ):
16121624 """
16131625 replace self internals with result.
16141626
16151627 Parameters
16161628 ----------
1617- verify_is_copy : boolean, default True
1618- provide is_copy checks
1629+ verify_parent : boolean, default True
1630+ provide parent checks
16191631
16201632 """
16211633 # NOTE: This does *not* call __finalize__ and that's an explicit
@@ -1624,7 +1636,7 @@ def _update_inplace(self, result, verify_is_copy=True):
16241636 self ._reset_cache ()
16251637 self ._clear_item_cache ()
16261638 self ._data = getattr (result ,'_data' ,result )
1627- self ._maybe_update_cacher (verify_is_copy = verify_is_copy )
1639+ self ._maybe_update_cacher (verify_parent = verify_parent )
16281640
16291641 def add_prefix (self , prefix ):
16301642 """
0 commit comments