PERF: avoid copies where possible · Issue #17449 · pandas-dev/pandas (original) (raw)

@jreback

This copies 3 times (even with the default copy=False)

In [2]: i = pd.date_range('20170101', periods=3, tz='US/Eastern')
In [3]: pd.Series(i)
Out[3]: 
0   2017-01-01 00:00:00-05:00
1   2017-01-02 00:00:00-05:00
2   2017-01-03 00:00:00-05:00
dtype: datetime64[ns, US/Eastern]

In theory we could get this to 0 copy (this is already correctly dtyped, so needs no conversion).