@@ -137,7 +137,11 @@ class Series(np.ndarray, generic.PandasObject):
137
137
138
138
_AXIS_NAMES = dict ((v , k ) for k , v in _AXIS_NUMBERS .iteritems ())
139
139
140
- def __new__ (cls , data , index = None , dtype = None , name = None , copy = False ):
140
+ def __new__ (cls , data = None , index = None , dtype = None , name = None ,
141
+ copy = False ):
142
+ if data is None :
143
+ data = {}
144
+
141
145
if isinstance (data , Series ):
142
146
if index is None :
143
147
index = data .index
@@ -165,7 +169,8 @@ def __new__(cls, data, index=None, dtype=None, name=None, copy=False):
165
169
166
170
return subarr
167
171
168
- def __init__ (self , data , index = None , dtype = None , name = None , copy = False ):
172
+ def __init__ (self , data = None , index = None , dtype = None , name = None ,
173
+ copy = False ):
169
174
"""One-dimensional ndarray with axis labels (including time
170
175
series). Labels must be unique and can any hashable type. The object supports
171
176
both integer- and label-based indexing and provides a host of methods for
@@ -456,8 +461,8 @@ def _tidy_repr(self, max_vals=20):
456
461
result = '%s\n %sLength: %d' % (result , namestr , len (self ))
457
462
return result
458
463
459
- def to_string (self , buf = None , na_rep = 'NaN' , float_format = None , nanRep = None ,
460
- length = False , name = False ):
464
+ def to_string (self , buf = None , na_rep = 'NaN' , float_format = None ,
465
+ nanRep = None , length = False , name = False ):
461
466
if nanRep is not None : # pragma: no cover
462
467
import warnings
463
468
warnings .warn ("nanRep is deprecated, use na_rep" ,
0 commit comments