Closed
Description
When instantiating a series with a datetimeindex but no data value (=None), a very slow codepath is used (involving Timestamp creation), compared to if a NaN value is supplied. The results are identical.
dr = pd.date_range(
start=datetime(2015,10,26),
end=datetime(2016,1,1),
freq='10s'
) # ~500k long
pd.Series(index=dr) # slow, 2.78 s
pd.Series(np.nan, index=dr) # fast, 0.01 s
pandas version 0.17.0