On Saturday, April 20, 2013 9:15:15 AM UTC-6, Terence wrote:
The original csv file data is like that:
06/04/2011,104.64,105.17
07/04/2011,104.98,105.51
08/04/2011,105.43,105.96
11/04/2011,104.47,104.99
How to either read the csv file into DataFrame and add multiple row index level, or add multiple row index into csv and import into DataFrame as following:
JAS
date bid ask
06/04/2011 104.64 105.17
07/04/2011 104.98 105.51
08/04/2011 105.43 105.96
11/04/2011 104.47 104.99
Given that no one has responded there must not be an obvious solution to your question. Maybe you could rephrase your question by explaining why you would need mutli-row index level? How would you use this?
Seems to me that multi-row index would be handled by a python variable name not a DataFrame:
data_JAS = pandas.read_csv('JAS.csv', index_col=0, names=['bid', 'ask'], parse_dates=True)
>>> data_JAS
Out[3]:
bid ask
2011-06-04 104.64 105.17
2011-07-04 104.98 105.51
2011-08-04 105.43 105.96
2011-11-04 104.47 104.99