Spaces:
No application file
No application file
| import streamlit as st | |
| import pandas as pd | |
| import plotly.express as px | |
| 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("Just loaded Data:") | |
| st.dataframe(data) | |
| # User selects x and y axes | |
| x_axis = st.selectbox("Choose X-axis:", data.columns) | |
| y_axis = st.selectbox("Choose Y-axis:", data.columns) | |
| # Generate scatter plot | |
| fig = px.scatter(data, x=x_axis, y=y_axis, title="Scatter Plot") | |
| st.plotly_chart(fig) | |