Save variables for different radio button selections

This behavior is normal as streamlit will rerun the whole script from top to buttom.

Have a look at the session state feature to solve your issue.