@@ -101,7 +101,7 @@ def __init__(self, data=None, index=None, columns=None,
101101 mgr = self ._init_mgr (
102102 data , axes = dict (index = index , columns = columns ), dtype = dtype , copy = copy )
103103 elif data is None :
104- data = {}
104+ data = DataFrame ()
105105
106106 if index is None :
107107 index = Index ([])
@@ -116,7 +116,7 @@ def __init__(self, data=None, index=None, columns=None,
116116 index = index ,
117117 kind = self ._default_kind ,
118118 fill_value = self ._default_fill_value )
119- mgr = dict_to_manager (data , columns , index )
119+ mgr = df_to_manager (data , columns , index )
120120 if dtype is not None :
121121 mgr = mgr .astype (dtype )
122122
@@ -156,7 +156,7 @@ def _init_dict(self, data, index, columns, dtype=None):
156156 kind = self ._default_kind ,
157157 fill_value = self ._default_fill_value ,
158158 copy = True )
159- sdict = {}
159+ sdict = DataFrame ()
160160 for k , v in compat .iteritems (data ):
161161 if isinstance (v , Series ):
162162 # Force alignment, no copy necessary
@@ -182,7 +182,7 @@ def _init_dict(self, data, index, columns, dtype=None):
182182 if c not in sdict :
183183 sdict [c ] = sp_maker (nan_vec )
184184
185- return dict_to_manager (sdict , columns , index )
185+ return df_to_manager (sdict , columns , index )
186186
187187 def _init_matrix (self , data , index , columns , dtype = None ):
188188 data = _prep_ndarray (data , copy = False )
@@ -229,12 +229,12 @@ def _unpickle_sparse_frame_compat(self, state):
229229 else :
230230 index = idx
231231
232- series_dict = {}
232+ series_dict = DataFrame ()
233233 for col , (sp_index , sp_values ) in compat .iteritems (series ):
234234 series_dict [col ] = SparseSeries (sp_values , sparse_index = sp_index ,
235235 fill_value = fv )
236236
237- self ._data = dict_to_manager (series_dict , columns , index )
237+ self ._data = df_to_manager (series_dict , columns , index )
238238 self ._default_fill_value = fv
239239 self ._default_kind = kind
240240
@@ -738,13 +738,13 @@ def applymap(self, func):
738738 """
739739 return self .apply (lambda x : lmap (func , x ))
740740
741- def dict_to_manager ( sdict , columns , index ):
742- """ create and return the block manager from a dict of series, columns, index """
741+ def df_to_manager ( sdf , columns , index ):
742+ """ create and return the block manager from a dataframe of series, columns, index """
743743
744744 # from BlockManager perspective
745745 axes = [_ensure_index (columns ), _ensure_index (index )]
746746
747- return create_block_manager_from_arrays ([sdict [c ] for c in columns ], columns , axes )
747+ return create_block_manager_from_arrays ([sdf [c ] for c in columns ], columns , axes )
748748
749749
750750def stack_sparse_frame (frame ):
0 commit comments