@@ -100,7 +100,7 @@ def __init__(self, data=None, index=None, columns=None,
100100 mgr = self ._init_mgr (
101101 data , axes = dict (index = index , columns = columns ), dtype = dtype , copy = copy )
102102 elif data is None :
103- data = {}
103+ data = DataFrame ()
104104
105105 if index is None :
106106 index = Index ([])
@@ -115,7 +115,7 @@ def __init__(self, data=None, index=None, columns=None,
115115 index = index ,
116116 kind = self ._default_kind ,
117117 fill_value = self ._default_fill_value )
118- mgr = dict_to_manager (data , columns , index )
118+ mgr = df_to_manager (data , columns , index )
119119 if dtype is not None :
120120 mgr = mgr .astype (dtype )
121121
@@ -155,7 +155,7 @@ def _init_dict(self, data, index, columns, dtype=None):
155155 kind = self ._default_kind ,
156156 fill_value = self ._default_fill_value ,
157157 copy = True )
158- sdict = {}
158+ sdict = DataFrame ()
159159 for k , v in compat .iteritems (data ):
160160 if isinstance (v , Series ):
161161 # Force alignment, no copy necessary
@@ -181,7 +181,7 @@ def _init_dict(self, data, index, columns, dtype=None):
181181 if c not in sdict :
182182 sdict [c ] = sp_maker (nan_vec )
183183
184- return dict_to_manager (sdict , columns , index )
184+ return df_to_manager (sdict , columns , index )
185185
186186 def _init_matrix (self , data , index , columns , dtype = None ):
187187 data = _prep_ndarray (data , copy = False )
@@ -228,12 +228,12 @@ def _unpickle_sparse_frame_compat(self, state):
228228 else :
229229 index = idx
230230
231- series_dict = {}
231+ series_dict = DataFrame ()
232232 for col , (sp_index , sp_values ) in compat .iteritems (series ):
233233 series_dict [col ] = SparseSeries (sp_values , sparse_index = sp_index ,
234234 fill_value = fv )
235235
236- self ._data = dict_to_manager (series_dict , columns , index )
236+ self ._data = df_to_manager (series_dict , columns , index )
237237 self ._default_fill_value = fv
238238 self ._default_kind = kind
239239
@@ -737,13 +737,13 @@ def applymap(self, func):
737737 """
738738 return self .apply (lambda x : lmap (func , x ))
739739
740- def dict_to_manager ( sdict , columns , index ):
741- """ create and return the block manager from a dict of series, columns, index """
740+ def df_to_manager ( sdf , columns , index ):
741+ """ create and return the block manager from a dataframe of series, columns, index """
742742
743743 # from BlockManager perspective
744744 axes = [_ensure_index (columns ), _ensure_index (index )]
745745
746- return create_block_manager_from_arrays ([sdict [c ] for c in columns ], columns , axes )
746+ return create_block_manager_from_arrays ([sdf [c ] for c in columns ], columns , axes )
747747
748748
749749def stack_sparse_frame (frame ):
0 commit comments