API: Use object dtype for empty Series (original) (raw)
Currently an empty Series has a float dtype:
In [15]: pd.Series().dtype Out[15]: dtype('float64')
This is consistent with NumPy, but inconsistent with the rest of pandas:
In [18]: pd.Index([]).dtype Out[18]: dtype('O')
In [19]: pd.DataFrame(columns=['A']).dtypes Out[19]: A object dtype: object
I think it's best to just make all our containers treat empty as object dtype, unless explicitly told otherwise (excluding specialized containers like Int64Index).