Streamlist - Clear screen on action

I’m new to this whole thing so I apologize in advance for any less than intelligent questions I pose

I have a DF created from a query into a mysql DB via the mysql.connector which works great.

Then I use streamiest to put up the grid.

I’m trying to filter and this is my code snippet.

after clicking on the widget, the filter is placed and the return grid follows the existing grid on the screen. Is there a way to just display the refreshed streamlit df?

result_dataFrame = pd.read_sql(query, mydb)

st.title(‘BDK Services Group’)


in1 = st.checkbox(“Phase 1 (BDK)”, key=“BDK”)
in2 = st.checkbox(“Phase 2 (BLDK)”, key=“BLDK”)
in3 = st.checkbox(“Phase 3 (TRI)”, key=“TRI”)

st.button(“Create PDF”, key=“CreatePDF”)

if in1:
result_dataFrame.loc[result_dataFrame[‘Investment’] == ‘BDK’]
if in2:
result_dataFrame.loc[result_dataFrame[‘Investment’] == ‘BLDK’]
if in3:
result_dataFrame.loc[result_dataFrame[‘Investment’] == ‘TRI’]


mydb.close() # close the connection