Final_Project / customer_analysis.py
GMARTINEZMILLA's picture
feat: generated files
2c1bfb4
raw
history blame
729 Bytes
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)