@@ -289,10 +289,7 @@ def set_axis(a, i):
289
289
for i , a in cls ._AXIS_NAMES .items ():
290
290
set_axis (a , i )
291
291
292
- # addtl parms
293
- if isinstance (ns , dict ):
294
- for k , v in ns .items ():
295
- setattr (cls , k , v )
292
+ assert not isinstance (ns , dict )
296
293
297
294
def _construct_axes_dict (self , axes = None , ** kwargs ):
298
295
"""Return an axes dictionary for myself."""
@@ -3483,8 +3480,10 @@ def add_prefix(self, prefix):
3483
3480
2 3 5
3484
3481
3 4 6
3485
3482
"""
3486
- new_data = self ._data .add_prefix (prefix )
3487
- return self ._constructor (new_data ).__finalize__ (self )
3483
+ f = functools .partial ('{prefix}{}' .format , prefix = prefix )
3484
+
3485
+ mapper = {self ._info_axis_name : f }
3486
+ return self .rename (** mapper )
3488
3487
3489
3488
def add_suffix (self , suffix ):
3490
3489
"""
@@ -3540,8 +3539,10 @@ def add_suffix(self, suffix):
3540
3539
2 3 5
3541
3540
3 4 6
3542
3541
"""
3543
- new_data = self ._data .add_suffix (suffix )
3544
- return self ._constructor (new_data ).__finalize__ (self )
3542
+ f = functools .partial ('{}{suffix}' .format , suffix = suffix )
3543
+
3544
+ mapper = {self ._info_axis_name : f }
3545
+ return self .rename (** mapper )
3545
3546
3546
3547
_shared_docs ['sort_values' ] = """
3547
3548
Sort by the values along either axis
@@ -4057,6 +4058,7 @@ def _reindex_with_indexers(self, reindexers, fill_value=None, copy=False,
4057
4058
4058
4059
return self ._constructor (new_data ).__finalize__ (self )
4059
4060
4061
+ # TODO: unused; remove?
4060
4062
def _reindex_axis (self , new_index , fill_method , axis , copy ):
4061
4063
new_data = self ._data .reindex_axis (new_index , axis = axis ,
4062
4064
method = fill_method , copy = copy )
0 commit comments