I have a data frame with my stock portfolio. I want to be able to add a stock to my portfolio on streamlit. I have text input in my sidebar where I input the Ticker, etc. When I try to add the Ticker at the end of my dataframe, it does not work.
ticker_add = st.sidebar.text_input("Ticker")
df['Ticker'][len(df)+1] = ticker_add
The code [len(df)+1]
does not work. When I try to do [len(df)-1]
, it works but I want to add it to the end of the dataframe, not replace the last stock. It seems like it can't add a row to the dataframe.