I am reading a stock daily data into a panda:
dpa = pd.read_csv(fname,parse_dates=['Date']) print(dpa.head(5))
Date Open High Low Close
0 2017-05-10 56.85 56.94 56.08 56.27
1 2017-05-11 56.13 56.38 55.80 56.23
2 2017-05-12 56.16 56.40 55.96 56.16
3 2017-05-15 56.07 56.76 56.01 56.70
4 2017-05-16 56.87 58.38 56.45 56.83
How can I use Date as the index and retrieve a column by specifying a date?
following didn't work:
Close = dpa.Close['2017-05-12']
Close = dpa['2017-05-12'].Close
I thought parse_dates = ['Date'] generates Date as index.