I am trying to create a csv file containing metadata in the first few lines followed by temporary data, so it can be processed by another web application. My csv file should look like this:
Code: ABC1
Frequency: Monthly
Description: Blah Blah
2/1/1947 11.7
3/1/1947 11.9
I can create a CSV metadata file:
metadata=pd.Series([('code: ABC123'),('freqency: monthly'),('description: describecode'),('--------')])
metadata.to_csv("metadata.csv",index=False)
I can create csv time series
a=pd.Series((11.7,11.9),index=pd.date_range('1947-01-02','1947-01-03'))
a.to_csv("data.csv")
But I can't figure out how to combine them together in a format at the top.
source
share