Spaces:
No application file
No application file
| import streamlit as st | |
| import pandas as pd | |
| import matplotlib.pyplot as plt | |
| st.title("CSV File Upload and Display") | |
| # File uploader | |
| uploaded_file = st.file_uploader("Upload a CSV file", type=["csv"]) | |
| if uploaded_file: | |
| data = pd.read_csv(uploaded_file) | |
| st.write("Line Chart Example:") | |
| st.line_chart(data) | |
| st.write("Bar Chart Example:") | |
| st.bar_chart(data) | |
| st.write("Custom Matplotlib Chart:") | |
| fig, ax = plt.subplots() | |
| ax.plot(data.iloc[:, 0], data.iloc[:, 1]) | |
| ax.set_title("Custom Line Plot") | |
| st.pyplot(fig) | |