File size: 1,075 Bytes
ce7a7ea
5d8f2db
 
 
ad4269b
5d8f2db
ce7a7ea
 
5d8f2db
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import streamlit as st
import pandas as pd
import matplotlib.pyplot as plt

st.title('P2024-074606-14875 - Sistema de Clasificación de granos de Café Verde	')


x = st.slider('Select a value')
st.write(x, 'squared is', x * x)


# Step 1: Upload CSV file
uploaded_file = st.file_uploader('Choose a CSV file', type='csv')

if uploaded_file is not None:
    # Step 2: Read the uploaded CSV file
    df = pd.read_csv(uploaded_file)
    st.write('Data Preview:')
    st.dataframe(df.head())

    # Step 3: Select columns for x and y axes
    columns = df.columns.tolist()
    x_axis = st.selectbox('Select X-axis column', columns)
    y_axis = st.selectbox('Select Y-axis column', columns)

    # Step 4: Plot the selected data
    if x_axis and y_axis:
        st.write(f'Plotting {x_axis} vs {y_axis}')
        fig, ax = plt.subplots()
        ax.plot(df[x_axis], df[y_axis], marker='o')
        ax.set_xlabel(x_axis)
        ax.set_ylabel(y_axis)
        ax.set_title(f'{y_axis} vs {x_axis}')
        st.pyplot(fig)
else:
    st.write('Please upload a CSV file to proceed.')