I have a python object imported from win2com which contains stock price quotations. numbars
is the number of bars in the stock history. quotations
is the object that contain the stock quotations.
To retrieve and store the prices and dates, the python code will look something like this;
for x in range(0,num_bars):
date_quote[x] = quotations(x).Date.date()
close[x] = quotations(x).Close
open[x] = quotations(x).Open
high[x] = quotations(x).Low
low[x] = quotations(x).High
volume[x] = quotations(x).Volume
open_int[x] = quotations(x).OpenInt
I just discovered panda dataframe today and thought it will be better to store the stock quotations data into panda dataframe to make use of the ecosystem built around panda. However, when I looked at the dataframe structure created by pandas_datareader
module, it looked highly complicated. Are there any convenient way, like an API or library, to store the stock data from quotations
object into panda data frame?
I am using python v3.6