I\'m trying to create an empty data frame with an index and specify the column types. The way I am doing it is the following:
df = pd.DataFrame(index=[\'pbp\
You can use the following:
df = pd.DataFrame({'a': pd.Series([], dtype='int'),
'b': pd.Series([], dtype='str'),
'c': pd.Series([], dtype='float')})
then if you call df you have
>>> df
Empty DataFrame
Columns: [a, b, c]
Index: []
and if you check its types
>>> df.dtypes
a int32
b object
c float64
dtype: object