dashboard
최적의 대시보드는 중요한 비지니스 질문에 대한 해답을 제시한다.
web-based dashboarding
ploty, panel, voila, streamlit, bokeh, matplotlib, Flask
1. ploty
python library이다.
40가지 unique한 chart가 있다.
financial, maps, scientific, statistical, 3-dimensional style
# Import required packages
import pandas as pd
import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.express as px
from dash.dependencies import Input, Output
# Add Dataframe
# Add a bar graph figure
# Add Dataframe
df = pd.DataFrame({
"Fruit": ["Apples", "Oranges", "Bananas", "Apples", "Oranges", "Bananas"],
"Amount": [4, 1, 2, 2, 4, 5],
"City": ["SF", "SF", "SF", "NYC", "MTL", "NYC"]
})
fig = px.bar(df, x="Fruit", y="Amount", color="City", barmode="group")
app = dash.Dash()
app.layout = html.Div(children=[
html.H1(
children='US Domestic Airline Flights Performance',
style={
'textAlign': 'center'
}
),
# Create dropdown
html.Label('Report type'),
dcc.Dropdown(options=[
{'label': 'Yearly airline performance report', 'value':'A'},
{'label': 'Yearly average flight delay statistics', 'value':'B'}
],
value='A' # Providing a vallue to dropdown
),
html.Label('Choose Year'),
dcc.Dropdown(
options=[
{'label': str(year), 'value': year} for year in range(2005, 2020)
],
placeholder="year"
),
# Bar graph
dcc.Graph(id='example-graph-2',figure=fig)
])
# Run Application
if __name__ == '__main__':
app.run_server()
airline_data = pd.read_csv('https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-DV0101EN-SkillsNetwork/Data%20Files/airline_data.csv',
encoding = "ISO-8859-1",
dtype={'Div1Airport': str, 'Div1TailNum': str,
'Div2Airport': str, 'Div2TailNum': str})
# Randomly sample 500 data points. Setting the random state to be 42 so that we get same result.
data = airline_data.sample(n=500, random_state=42)
'Certificate > data science-IBM' 카테고리의 다른 글
data visualization, dashboard, plotly기초 (0) | 2023.05.23 |
---|---|
data methodololy, CRISP-DM, 데이터분석 단계 (0) | 2023.05.22 |
waffle chart, word clouds, regplot, folium, choropleth maps (0) | 2023.05.10 |
pie chart, box chart, scatter chart, subplot (1) | 2023.05.09 |
area plot, histogram, bar chart, annotate (0) | 2023.05.09 |