-
-
Save karanjagota/45c11a47c5b92df5cb8b190641dc1333 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Display barplot and data on search Input | |
_input = st.text_input("Enter Year to Search") | |
if _input: | |
_df = df[df['year'] == int(_input)] | |
if len(_df['year'])>0: | |
_df | |
if len(_df['year'])>0: | |
sns.set_theme(style="whitegrid") | |
fig, ax = plt.subplots() | |
fig = plt.figure(figsize=(7, 4)) | |
ax = sns.barplot(data=_df, y="Lf-overall", x="year", hue="country", palette="tab20_r") | |
st.pyplot(fig) | |
else: | |
st.write('Data Does Not Exist in the Database') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment