I want to make a st.selectbox with the code below.
When I select Males vs Females, it shows that graph.
How can I put those code under selectbox?
st.write('Males vs Females')
gender_count = my_pop.groupby('Offences')['Males', 'Females'].sum()
gender_count.columns = ['Males','Females']
st.bar_chart(data = gender_count, use_container_width=True)
st.write('Adults vs Juveniles')
gender_count = my_pop.groupby('Offences')['Adults', 'Juveniles'].sum()
gender_count.columns = ['Adults','Juveniles']
st.bar_chart(data = gender_count, use_container_width=True)