Hi,
It seems that pyfolio usually retrieves historical data from yahoo finance, but I would like to be able to run the library using data imported from an excel file, as following:
import pyfolio as pf
import pandas as pd
%matplotlib inline
s = pd.read_excel('C:/Users/User/Desktop/Documentos/Dados históricos.xlsx')
data = s.Returns
print(s)
print(type(data))
benchmark = s.Returns
pf.create_returns_tear_sheet(data, benchmark)
In my understandings, retrieving data from excel is possible, but I keep getting the following error:
TypeError: Already tz-aware, use tz_convert to convert.
Can someone help me fix the code?
Thank you very much.
Best regards,