-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
30 lines (22 loc) · 1.01 KB
/
Copy pathapp.py
File metadata and controls
30 lines (22 loc) · 1.01 KB
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
import pandas as pd
import plotly.express as px
import streamlit as st
from pathlib import Path
car_data = pd.read_csv(Path("data/vehicles_us.csv")) # lendo os dados
st.header('Dashboard de Veículos')
hist_button = st.button('Criar histograma') # criar um botão
if hist_button: # se o botão for clicado
# escrever uma mensagem
st.write('Criando um histograma para o conjunto de dados de anúncios de vendas de carros')
# criar um histograma
fig = px.histogram(car_data, x="odometer")
# exibir um gráfico Plotly interativo
st.plotly_chart(fig, use_container_width=True)
disp_button = st.button('Criar gráfico de dispersão') # criar um botão
if disp_button: # se o botão for clicado
# escrever uma mensagem
st.write('Criando um gráfico de dispersão para o conjunto de dados de anúncios de vendas de carros')
# criar um histograma
fig = px.scatter(car_data, x="odometer", y="price")
# exibir um gráfico Plotly interativo
st.plotly_chart(fig, use_container_width=True)