Closed
Description
I thought we had an issue for this, but couldn't find it.
In [41]: df = pd.DataFrame(columns=['A'])
In [42]: df.index.dtype
Out[42]: dtype('O')
In [43]: df['A'] = []
In [44]: df.index.dtype
Out[44]: dtype('int64')
In [45]: df.index
Out[45]: RangeIndex(start=0, stop=0, step=1)
I this should still be empty an empty Index
(though see #16961 which proposes change pd.Series()
to have that use a range index. Not sure if that's a good idea or not).
xref dask/dask#2564