@@ -191,6 +191,13 @@ def fill_value(self):
191
191
def mgr_locs (self ):
192
192
return self ._mgr_locs
193
193
194
+ @mgr_locs .setter
195
+ def mgr_locs (self , new_mgr_locs ):
196
+ if not isinstance (new_mgr_locs , BlockPlacement ):
197
+ new_mgr_locs = BlockPlacement (new_mgr_locs )
198
+
199
+ self ._mgr_locs = new_mgr_locs
200
+
194
201
@property
195
202
def array_dtype (self ):
196
203
""" the dtype to return if I want to construct this block as an
@@ -224,13 +231,6 @@ def make_block_same_class(self, values, placement=None, fastpath=True,
224
231
return make_block (values , placement = placement , klass = self .__class__ ,
225
232
fastpath = fastpath , ** kwargs )
226
233
227
- @mgr_locs .setter
228
- def mgr_locs (self , new_mgr_locs ):
229
- if not isinstance (new_mgr_locs , BlockPlacement ):
230
- new_mgr_locs = BlockPlacement (new_mgr_locs )
231
-
232
- self ._mgr_locs = new_mgr_locs
233
-
234
234
def __unicode__ (self ):
235
235
236
236
# don't want to print out all of the items here
@@ -840,7 +840,6 @@ def setitem(self, indexer, value, mgr=None):
840
840
841
841
transf = (lambda x : x .T ) if self .ndim == 2 else (lambda x : x )
842
842
values = transf (values )
843
- l = len (values )
844
843
845
844
# length checking
846
845
# boolean with truth values == len of the value is ok too
@@ -855,7 +854,7 @@ def setitem(self, indexer, value, mgr=None):
855
854
# slice
856
855
elif isinstance (indexer , slice ):
857
856
858
- if is_list_like (value ) and l :
857
+ if is_list_like (value ) and len ( values ) :
859
858
if len (value ) != length_of_indexer (indexer , values ):
860
859
raise ValueError ("cannot set using a slice indexer with a "
861
860
"different length than the value" )
0 commit comments