This post provides an elegant way to create an empty pandas DataFrame of a specified data type. And if you specify np.nan values when you initialize it, the data type is set to float:
df_training_outputs = pd.DataFrame(np.nan, index=index, columns=column_names)
But I want to create an empty DataFrame with different data types in each column. It seems the dtype keyword argument will only accept one.
Background: I am writing a script that generates data incrementally and so I need somewhere to store it during the execution of the script. I thought an empty data frame (large enough to take all the expected data) would be the best way to do this. This must be a fairly common tasks so if someone has a better way please advise.