🌶️🌶️🌶️
I've done. Here is my code:
import streamlit as st
import pandas as pd
import matplotlib.pyplot as plt
# Title of the app
st.title('Data Dashboard')
# file uploader
uploaded_file = st.file_uploader("Choose a CSV file", type="csv")
if uploaded_file is not None:
# Read the csv file
df = pd.read_csv(uploaded_file)
# Display the DataFrame
st.write(df)
# Select field for plotting
fields = df.columns.tolist()
details_plot = st.selectbox('Select a column to plot', fields)
st.write(f"Plotting column {details_plot}:")
if details_plot:
# Plotting
fig, ax = plt.subplots()
ax.plot(df[details_plot])
st.pyplot(fig)
I've done. Here is my code:
import streamlit as st
import pandas as pd
import matplotlib.pyplot as plt
# Title of the app
st.title('Data Dashboard')
# file uploader
uploaded_file = st.file_uploader("Choose a CSV file", type="csv")
if uploaded_file is not None:
# Read the csv file
df = pd.read_csv(uploaded_file)
# Display the DataFrame
st.write(df)
# Select field for plotting
fields = df.columns.tolist()
details_plot = st.selectbox('Select a column to plot', fields)
st.write(f"Plotting column {details_plot}:")
if details_plot:
# Plotting
fig, ax = plt.subplots()
ax.plot(df[details_plot])
st.pyplot(fig)