I would like to modify an existing excel via openpyxl. The purpose is to take finance data and insert it in the specific columns so that it can perform the calculations.
I would like column 1 to show the opening prices
I write this code.
import datetime as dt
import pandas as pd
import pandas_datareader.data as web
from openpyxl import load_workbook
start = dt.datetime(2018, 1, 1)
end = dt.datetime(2019, 1, 1)
ticker = "AAPL"
yahoo = web.DataReader(ticker, 'yahoo', start, end)
#print(yahoo['Open'])
wb = load_workbook('aa.xlsx')
ws = wb.active
ws.title = "Change Sheet__"
ws["A"].value(aaa)
wb.save("aa.xlsx")
The error is:
Traceback (most recent call last): File "C:\Users\Davide\Desktop\aa.py", line 23, in ws["A"].value(aaa) AttributeError: 'tuple' object has no attribute 'value'