Summary
Share a clear and concise description of the issue. Aim for 2-3 sentences.
Steps to reproduce
Code snippet:
import streamlit as st
import pandas as pd
import numpy as np
df=pd.DataFrame(
[{"x":1,"y":0},
{"x":2,"y":0},
{"x":3,"y":0},
{"x":4,"y":0},
]
)
edit_df=st.data_editor(df,num_rows="dynamic")
x1=edit_df.x.dropna()
y1=x1**2
edit_df.y=y1
If applicable, please provide the steps we should take to reproduce the error or specified behavior.
I want to get the input data x col in edit_df, update y col to x*x and show the new y on my appâ
Explain what you expect to happen when you run the code above.
Actual behavior: the y col doesnât update as my expect
Explain the undesired behavior or error you see when you run the code above.
If youâre seeing an error message, share the full contents of the error message here.
Debug info
- Streamlit version: 1.25.0
- Python version: 3.9.8
- PyEnv
- OS version: windows 10 22h2
- Browser version: Edge 115.0.1901.203
Additional information
Hey every one, Iâm new to streamlit and want to create a simple app which has the function I mention above but finally failed. Could anyone explain why the y col doesnât update and tell me what happens after I input new number to the dynamic data editor? Will streamlit rerun the script automatically or something else? Thanks a lot!