-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
33 lines (27 loc) · 997 Bytes
/
app.py
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
import pandas as pd
import plotly.express as px
import streamlit as st
# Leer datos
data = pd.read_csv('vehicles_us.csv')
# Título
st.title("Panel de Control de Anuncios de Vehículos")
# Histograma de precios
st.header("Distribución de Precios")
fig = px.histogram(data, x="price")
st.plotly_chart(fig, use_container_width=True)
# Gráfico de dispersión precio vs año
st.header("Precio vs Año")
fig = px.scatter(data, x="model_year", y="price")
st.plotly_chart(fig, use_container_width=True)
# Histograma de precios
st.header("Distribución de Precios")
show_hist = st.checkbox("Mostrar Histograma de Precios")
if show_hist:
fig = px.histogram(data, x="price")
st.plotly_chart(fig, use_container_width=True)
# Gráfico de dispersión precio vs año
st.header("Precio vs Año")
show_scatter = st.checkbox("Mostrar Gráfico de Dispersión Precio vs Año")
if show_scatter:
fig = px.scatter(data, x="model_year", y="price")
st.plotly_chart(fig, use_container_width=True)