I am getting an error when I am trying to draw a candlestick using st.plotly_chart(). I am using yfinance to pull the stock data. For some reason it does not like the date key. Here is the error I am getting.
I believe these are all the relevant lines of code.
spy = yf.Ticker('SPY')
spy_History = spy.history(period='5d')
fig = go.Figure(data=[go.Candlestick(x=spy_History['Date'],
open=spy_History['Open'],
high=spy_History['High'],
low=spy_History['Low'],
close=spy_History['Close'])])
fig.update_layout(xaxis_rangeslider_visible=False)
st.plotly_chart(fig, theme='streamlit')
Also, here is what the Dataframe of the information looks like. Perhaps the time stamp after the date is messing it up? Any way to remove that? Any help is appreciated!