File size: 729 Bytes
2c1bfb4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import streamlit as st
import pandas as pd
import plotly.express as px

st.set_page_config(page_title="Customer Analysis", page_icon=":mag:")

st.title("Customer Analysis")
st.markdown("""
    Use the tools below to explore your customer data.
""")

# Cargar y visualizar datos
uploaded_file = st.file_uploader("Upload your CSV file", type="csv")
if uploaded_file:
    df = pd.read_csv(uploaded_file)
    st.write("## Dataset Overview", df.head())

    # Mostrar un gráfico interactivo
    st.markdown("### Sales per Customer")
    customer_sales = df.groupby("CLIENTE")["VENTA_ANUAL"].sum().reset_index()
    fig = px.bar(customer_sales, x="CLIENTE", y="VENTA_ANUAL", title="Annual Sales per Customer")
    st.plotly_chart(fig)