BUG: DataFrame.append with empty DataFrame and Series with tz-aware datetime value allocated object column by simonjayhawkins · Pull Request #35038 · pandas-dev/pandas (original) (raw)
it's a different issue for period and interval since concatenating list of Series doesn't work either, whereas for tz-aware datetime works on master. see OP
>>> interval = pd.Interval(0, 1, closed="right")
>>> interval
Interval(0, 1, closed='right')
>>>
>>> period = pd.Period("2012", freq="A-DEC")
>>> period
Period('2012', 'A-DEC')
>>>
>>> s = pd.Series({"period": period, "interval": interval})
>>> s
period 2012
interval (0, 1]
dtype: object
>>>
>>> df = pd.DataFrame(columns=["c"])
>>> df
Empty DataFrame
Columns: [c]
Index: []
>>>
>>> result = df.append([s, s], ignore_index=True)
>>> result
c period interval
0 NaN 2012 (0, 1]
1 NaN 2012 (0, 1]
>>>
>>> result.dtypes
c object
period object
interval object
dtype: object
>>>
>>> df = pd.DataFrame([s, s])
>>> df
period interval
0 2012 (0, 1]
1 2012 (0, 1]
>>>
>>> df.dtypes
period period[A-DEC]
interval interval[int64]
dtype: object
>>>