├── LICENSE ├── Practice Exercise_Making a life expectancy dashboard.txt ├── Practice Exercise_Making an avocado prices dashboard.txt ├── README.md ├── adding_callbacks_live_update_the_chart.py ├── adding_callbacks_live_update_the_datatable.py ├── adding_callbacks_update_the_datatable.py ├── adding_callbacks_update_the_map.py ├── avocado.csv ├── avocado.ipynb ├── avocado_dashboard_solution.py ├── building_a_deck_of_cards.py ├── building_a_navigation_bar.py ├── building_callbacks_with_multiple_inputs_outputs.py ├── building_callbacks_with_single_input_output.py ├── building_callbacks_with_single_input_output_without_id.py ├── chaining_callbacks_inputs_and_outputs.py ├── controlling_callbacks_with_states_button.py ├── core_components_overview.py ├── creating_a_grid_layout.py ├── creating_interactive_plotly_figures.py ├── creating_your_first_dashboard.py ├── customizing_with_external_css.py ├── customizing_with_inline_css.py ├── electricity.csv ├── fifa_soccer_players.csv ├── html_components_overview.py ├── intro_to_jupyterdash.ipynb ├── life_expectancy.csv ├── life_expectancy_dashboard_solution.py ├── setting_up_the_layout_candlestick_datatable.py ├── setting_up_the_layout_datatable.py ├── setting_up_the_layout_input_button.py ├── setting_up_the_layout_interval.py ├── setting_up_the_layout_map.py ├── setting_up_the_layout_rangeslider.py ├── setting_up_the_layout_tabs.py └── world_happiness.csv /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Packt 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Practice Exercise_Making a life expectancy dashboard.txt: -------------------------------------------------------------------------------- 1 | Context 2 | 3 | 4 | You've learned a lot in this course! So let's practice the key knowledge, and even learn something new in this last exercise. 5 | 6 | 7 | 8 | How did life expectancy change in our world? 9 | 10 | You'll build a stylish, interactive dashboard to answer this question. Please check out the final dashboard here. Please explore the dashboard, and use it as a reference throughout the exercise. 11 | 12 | You can follow the step-by-step instructions below. To make the practice more realistic and challenging, we didn't list details. Please aim for making the dashboard look roughly the same, and have the same interactive features. 13 | 14 | 15 | 16 | Good luck! 17 | 18 | 19 | 20 | Instructions 21 | 22 | 23 | Step 1: Exploring the dataset 24 | 25 | - Open the life_expectancy.csv file 26 | 27 | Suppose we want to compare the changes in life expectancy for different countries across time. What are the columns in the dataset we'll be using? 28 | 29 | 30 | 31 | Step 2: Preparing to build the Dash app 32 | 33 | - Import the libraries 34 | 35 | Please explore the final dashboard to see the necessary libraries. Yet, you can always add more libraries later. 36 | 37 | 38 | 39 | - Read the csv file as a pandas DataFrame 40 | 41 | 42 | 43 | - Create a Dash object called app, link to the standard Bootstrap stylesheet 44 | 45 | 46 | 47 | Step 3: Building the layout 48 | 49 | - Put the following components into the layout: 50 | 51 | - NavbarSimple as shown on the final dashboard: 52 | 53 | - data source: https://ourworldindata.org/life-expectancy 54 | 55 | - sticky on top 56 | 57 | Hint: in the course, we didn't show how to style the brand text or make the bar sticky. Please research the official doc of NavbarSimple for the solution. This is how you learn to use a new Dash component. 58 | 59 | 60 | 61 | - A Card to hold: 62 | 63 | - a heading of 'Life expectancy by countries' 64 | 65 | - a year RangeSlider as shown in the final dashboard, with the currently selected range being the entire range. This RangeSlider will be used in a callback function 66 | 67 | - use the tooltip property to display the current value of the RangeSlider 68 | 69 | Hint: please research the official doc for how to use tooltip 70 | 71 | 72 | 73 | - A line breaker 74 | 75 | 76 | 77 | - A multi-value Dropdown component, which shows the unique countries. It will be used in a callback function 78 | 79 | Hint: we didn't show the multi-value Dropdown in the course. But you can research it in the official doc of the Dropdown component. 80 | 81 | 82 | 83 | - A line breaker 84 | 85 | 86 | 87 | - A Button that will be used in a callback function 88 | 89 | 90 | 91 | - A line breaker 92 | 93 | 94 | 95 | - A Graph component that will be used in a callback function 96 | 97 | 98 | 99 | We strongly suggest testing out the code to see if the layout looks good, before moving on to the next step. 100 | 101 | Again, since we didn't provide all the details, you've completed the layout as long as it looks similar to the final dashboard. 102 | 103 | 104 | 105 | Step 4: Adding callback function 106 | 107 | The callback connects the year RangeSlider, country Dropdown, submit Button, and the Graph 108 | 109 | Interactive feature: explore by 110 | 111 | - changing the selection of the year RangeSlider 112 | 113 | - select multiple countries in the Dropdown 114 | 115 | - click the submit Button 116 | 117 | What happens to the Graph? 118 | 119 | 120 | 121 | Hints: 122 | 123 | - Note that the update only happens after the submit Button is clicked. 124 | 125 | - Don't forget that the value property of the country Dropdown could have multiple values, so try the isin method when filtering. 126 | 127 | - If you didn't set the value property within the country Dropdown, you would get an error message as below: 128 | 129 | 130 | 131 | Callback error updating life-expectancy-graph.figure 132 | 133 | TypeError: only list-like objects are allowed to be passed to isin(), you passed a [NoneType] 134 | 135 | 136 | 137 | This is because, without the value property, the country Dropdown's value can be None. 138 | 139 | You can use the PreventUpdate command: 140 | 141 | - from dash.exceptions import PreventUpdate 142 | 143 | - add the below code to the beginning of the callback function: 144 | 145 | if selected_country is None: 146 | raise PreventUpdate 147 | # selected_country is the input variable name corresponding to the country Dropdown's value property 148 | When nothing is selected in the country Dropdown, selected_country is None, the PreventUpdate command prevents the updating of the output. This will fix the problem. 149 | 150 | Alternatively, you can also return an empty figure, as shown in the lessons of Case study II. 151 | 152 | 153 | 154 | Step 5: Testing the dashboard 155 | 156 | Run the script and test the interactive features 157 | 158 | Again, as long as you have a similar layout and the same interactive features as the final dashboard, you've completed the exercise! 159 | 160 | 161 | 162 | Please check out the solution in life_expectancy_dashboard_solution.py. -------------------------------------------------------------------------------- /Practice Exercise_Making an avocado prices dashboard.txt: -------------------------------------------------------------------------------- 1 | Context 2 | 3 | 4 | You've learned all the basics for making dashboards using Dash! It's time to test your knowledge. 5 | 6 | In this exercise, you'll build an interactive dashboard with a dropdown menu, a figure, plus a callback function to connect them together. The users can interact with the dashboard by changing the option in the dropdown menu and seeing an updated figure. 7 | 8 | We'll be using the avocado dataset from Kaggle (download from Resources). 9 | 10 | 11 | 12 | Two ways to complete the exercise 13 | 14 | 15 | - Build the dashboard without any hints by looking at the final dashboard (https://python-dash-tutorial-example.herokuapp.com/) 16 | 17 | - Follow the below instructions and build it step-by-step. Please try to write the code by yourself before looking at the solution. 18 | 19 | 20 | 21 | Instructions 22 | 23 | 24 | Step 1: Exploring the dataset 25 | 26 | - Open the avocado.csv file 27 | 28 | Suppose we want to present the average prices of different types of avocados for various geographies across time. What are the columns in the dataset we'll be using? 29 | 30 | It's also better to explore the dataset in Jupyter Notebook before building the dashboard. This is optional for this exercise. But if you'd like, please check out our notebook (avocado.ipynb). 31 | 32 | 33 | 34 | Step 2: Preparing to build the Dash app 35 | 36 | - Go to an editor like PyCharm and create a new Python file 37 | 38 | - Import the libraries 39 | 40 | Hint: libraries are needed for loading the dataset, building core, html components, plotly figures, as well as callback functions 41 | 42 | - Read the csv file as a pandas DataFrame called avocado 43 | 44 | Hint: save the Python script and the dataset avocado.csv in the same directory to avoid setting the path in the read_csv function 45 | 46 | - Create a Dash app object called app 47 | 48 | 49 | 50 | Step 3: Building the layout 51 | 52 | - Use the keyword layout of the app to specify its layout 53 | 54 | - Put three components into the layout: 55 | 56 | - H1 heading with text ‘Avocado Prices Dashboard’ 57 | 58 | - A Dropdown with properties: 59 | 60 | - id as 'geo-dropdown', or you can assign the component as a variable 'geo_dropdown' 61 | 62 | - options as the unique values based on column geography 63 | 64 | - value as ‘New York’ 65 | 66 | - A Graph component with id ‘price-graph’ 67 | 68 | Hints: 69 | 70 | - Don't forget to use the Div container to hold all three components as a list 71 | 72 | - Use the two modules: dash_html_components (html) and dash_core_components (dcc) to build components, for example, html.Div 73 | 74 | - Pay attention to the capitalization of the letters in these components 75 | 76 | 77 | 78 | Step 4: Adding the callback function 79 | 80 | - Write the decorator section of the callback function 81 | 82 | - start with @app.callback 83 | 84 | - specify the Output and the Input objects by defining their ids and properties 85 | 86 | - the output is the figure property of the graph component 87 | 88 | - the input is the value property of the dropdown component 89 | 90 | Hint: to define the Input object, use syntax Input('component_id', 'component_property') 91 | 92 | - Define the function below the decorator 93 | 94 | - Start with the keyword def 95 | 96 | - Give it a function name update_graph 97 | 98 | - Call its input parameter selected_geography 99 | 100 | - Generate a filtered dataset called filtered_avocado when geography is selected_geography 101 | 102 | - Create a plotly line figure called line_fig based on this filtered dataset. This figure shows the average prices of different types of avocados across time. Also, give it the title of Avocado Prices in selected_geography. 103 | 104 | - Return the line_fig as the output 105 | 106 | Hints: 107 | 108 | - The callback function has the same syntax as a regular Python function 109 | 110 | - Use the plotly.express (px) to generate the line figure. Besides the dataset, we need to specify its arguments x, y, color, and title 111 | 112 | - Use an f-string to make the title of the figure depending on a variable 113 | 114 | 115 | 116 | Step 5: Running the dashboard 117 | 118 | - Add the code to run the server with debug being True 119 | 120 | - Run the script and take a look 121 | 122 | Hint: check whether __name__ == '__main__' before using the run_server method 123 | 124 | 125 | 126 | Please check out the solution in avocado_dashboard_solution.py. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | # Python-Interactive-Dashboards-with-Plotly-Dash 5 | Python Interactive Dashboards with Plotly Dash, by Packt Publishing 6 | -------------------------------------------------------------------------------- /adding_callbacks_live_update_the_chart.py: -------------------------------------------------------------------------------- 1 | from dash import Dash, html, dcc, dash_table, Input, Output, State 2 | import plotly.graph_objects as go 3 | import yfinance as yf 4 | 5 | app = Dash() 6 | 7 | 8 | price = yf.Ticker('AAPL').history(period='1d', interval='15m').reset_index() 9 | 10 | app.layout = html.Div([ 11 | html.H1('My financial dashboard'), 12 | dcc.Input(id='ticker-input', 13 | placeholder='Search for symbols from Yahoo Finance', 14 | style={'width': '50%'}), 15 | html.Button(id='submit-button', children='Submit'), 16 | html.Br(), 17 | html.Br(), 18 | dcc.Tabs([ 19 | dcc.Tab(label='Candlestick Chart', 20 | children=dcc.Graph(id='stock-graph')), 21 | dcc.Tab(label='Recent Data', 22 | children=dash_table.DataTable(id='stock-data', 23 | data=price.tail(10).to_dict('records'))) 24 | ]), 25 | dcc.Interval(id='chart-interval', interval=1000*60*15, n_intervals=0), 26 | dcc.Interval(id='table-interval', interval=1000*60, n_intervals=0) 27 | ]) 28 | 29 | 30 | @app.callback(Output('stock-graph', 'figure'), 31 | Input('submit-button', 'n_clicks'), 32 | Input('chart-interval', 'n_intervals'), 33 | State('ticker-input', 'value')) 34 | def update_chart(button_click, chart_interval, ticker): 35 | if ticker is None: 36 | return {} 37 | else: 38 | price = yf.Ticker(ticker).history(period='1d', interval='15m').reset_index() 39 | if len(price) > 0: 40 | fig = go.Figure(data=go.Candlestick( 41 | x=price['Datetime'], 42 | open=price['Open'], 43 | high=price['High'], 44 | low=price['Low'], 45 | close=price['Close'])) 46 | return fig 47 | else: 48 | return {} 49 | 50 | 51 | if __name__ == '__main__': 52 | app.run_server(debug=True) 53 | -------------------------------------------------------------------------------- /adding_callbacks_live_update_the_datatable.py: -------------------------------------------------------------------------------- 1 | from dash import Dash, html, dcc, dash_table, Input, Output, State 2 | import plotly.graph_objects as go 3 | import yfinance as yf 4 | 5 | app = Dash() 6 | 7 | 8 | app.layout = html.Div([ 9 | html.H1('My financial dashboard'), 10 | dcc.Input(id='ticker-input', 11 | placeholder='Search for symbols from Yahoo Finance', 12 | style={'width': '50%'}), 13 | html.Button(id='submit-button', children='Submit'), 14 | html.Br(), 15 | html.Br(), 16 | dcc.Tabs([ 17 | dcc.Tab(label='Candlestick Chart', 18 | children=dcc.Graph(id='stock-graph')), 19 | dcc.Tab(label='Recent Data', 20 | children=[html.Div(id='latest-price-div'), 21 | dash_table.DataTable(id='stock-data')]) 22 | ]), 23 | dcc.Interval(id='chart-interval', interval=1000*60*15, n_intervals=0), 24 | dcc.Interval(id='table-interval', interval=1000*60, n_intervals=0) 25 | ]) 26 | 27 | 28 | @app.callback(Output('stock-graph', 'figure'), 29 | Input('submit-button', 'n_clicks'), 30 | Input('chart-interval', 'n_intervals'), 31 | State('ticker-input', 'value')) 32 | def update_chart(button_click, chart_interval, ticker): 33 | if ticker is None: 34 | return {} 35 | else: 36 | price = yf.Ticker(ticker).history(period='1d', interval='15m').reset_index() 37 | if len(price) > 0: 38 | fig = go.Figure(data=go.Candlestick( 39 | x=price['Datetime'], 40 | open=price['Open'], 41 | high=price['High'], 42 | low=price['Low'], 43 | close=price['Close'])) 44 | return fig 45 | else: 46 | return {} 47 | 48 | 49 | @app.callback(Output('latest-price-div', 'children'), 50 | Output('stock-data', 'data'), 51 | Input('submit-button', 'n_clicks'), 52 | Input('table-interval', 'n_intervals'), 53 | State('ticker-input', 'value')) 54 | def update_table(button_click, table_interval, ticker): 55 | if ticker is None: 56 | return '', [] 57 | else: 58 | price = yf.Ticker(ticker).history(period='1d', interval='1m').reset_index().tail(10) 59 | if len(price) > 0: 60 | latest_price = price['Close'].iloc[-1] 61 | latest_time = price['Datetime'].max().strftime('%b %d %Y %I:%M:%S %p') 62 | return f'The latest price is {latest_price} at the time of {latest_time}', \ 63 | price.to_dict('records') 64 | else: 65 | return f'No data for ticker {ticker} on Yahoo Finance', [] 66 | 67 | 68 | if __name__ == '__main__': 69 | app.run_server(debug=True) 70 | -------------------------------------------------------------------------------- /adding_callbacks_update_the_datatable.py: -------------------------------------------------------------------------------- 1 | from dash import Dash, html, dcc, dash_table, Input, Output 2 | import dash_bootstrap_components as dbc 3 | import plotly.express as px 4 | import pandas as pd 5 | 6 | electricity = pd.read_csv('electricity.csv') 7 | 8 | year_min = electricity['Year'].min() 9 | year_max = electricity['Year'].max() 10 | 11 | 12 | app = Dash(external_stylesheets=[dbc.themes.SOLAR]) 13 | 14 | app.layout = html.Div([ 15 | html.H1('Electricity Prices by US State'), 16 | dcc.RangeSlider(id='year-slider', 17 | min=year_min, 18 | max=year_max, 19 | value=[year_min, year_max], 20 | marks={i: str(i) for i in range( 21 | year_min, year_max+1)} 22 | ), 23 | dcc.Graph(id='map-graph'), 24 | dash_table.DataTable( 25 | id='price-info' 26 | ) 27 | ]) 28 | 29 | 30 | @app.callback( 31 | Output('map-graph', 'figure'), 32 | Input('year-slider', 'value')) 33 | def update_map_graph(selected_years): 34 | filtered_electricity = electricity[( 35 | electricity['Year'] >= selected_years[0]) & (electricity['Year'] <= selected_years[1])] 36 | avg_price_electricity = filtered_electricity.groupby('US_State')['Residential Price'].mean().reset_index() 37 | map_fig = px.choropleth(avg_price_electricity, 38 | locations='US_State', locationmode='USA-states', 39 | color='Residential Price', scope='usa', 40 | color_continuous_scale='reds') 41 | return map_fig 42 | 43 | 44 | @app.callback( 45 | Output('price-info', 'data'), 46 | Input('map-graph', 'clickData'), 47 | Input('year-slider', 'value')) 48 | def update_datatable(clicked_data, selected_years): 49 | if clicked_data is None: 50 | return [] 51 | us_state = clicked_data['points'][0]['location'] 52 | filtered_electricity = electricity[ 53 | (electricity['Year'] >= selected_years[0]) & 54 | (electricity['Year'] <= selected_years[1]) & 55 | (electricity['US_State'] == us_state)] 56 | return filtered_electricity.to_dict('records') 57 | 58 | 59 | if __name__ == '__main__': 60 | app.run_server(debug=True) 61 | -------------------------------------------------------------------------------- /adding_callbacks_update_the_map.py: -------------------------------------------------------------------------------- 1 | from dash import Dash, html, dcc, dash_table, Input, Output 2 | import dash_bootstrap_components as dbc 3 | import plotly.express as px 4 | import pandas as pd 5 | 6 | electricity = pd.read_csv('electricity.csv') 7 | 8 | year_min = electricity['Year'].min() 9 | year_max = electricity['Year'].max() 10 | 11 | app = Dash(external_stylesheets=[dbc.themes.SOLAR]) 12 | 13 | app.layout = html.Div([ 14 | html.H1('Electricity Prices by US State'), 15 | dcc.RangeSlider(id='year-slider', 16 | min=year_min, 17 | max=year_max, 18 | value=[year_min, year_max], 19 | marks={i: str(i) for i in range( 20 | year_min, year_max+1)} 21 | ), 22 | dcc.Graph(id='map-graph'), 23 | dash_table.DataTable( 24 | id='price-info', 25 | data=electricity.to_dict('records') 26 | ) 27 | ]) 28 | 29 | 30 | @app.callback( 31 | Output('map-graph', 'figure'), 32 | Input('year-slider', 'value')) 33 | def update_map_graph(selected_years): 34 | filtered_electricity = electricity[( 35 | electricity['Year'] >= selected_years[0]) 36 | & (electricity['Year'] <= selected_years[1])] 37 | avg_price_electricity = filtered_electricity.groupby('US_State')['Residential Price'].mean().reset_index() 38 | map_fig = px.choropleth(avg_price_electricity, 39 | locations='US_State', locationmode='USA-states', 40 | color='Residential Price', scope='usa', 41 | color_continuous_scale='reds') 42 | return map_fig 43 | 44 | 45 | if __name__ == '__main__': 46 | app.run_server(debug=True) 47 | -------------------------------------------------------------------------------- /avocado_dashboard_solution.py: -------------------------------------------------------------------------------- 1 | # Step 1: Exploring the dataset 2 | # The columns that will be used are: date, average_price, type, and geography 3 | 4 | 5 | # Step 2: Preparing to build the Dash app 6 | from dash import Dash, html, dcc, Input, Output 7 | import pandas as pd 8 | import plotly.express as px 9 | 10 | avocado = pd.read_csv('avocado.csv') 11 | 12 | app = Dash() 13 | 14 | 15 | # Step 3: Building the layout 16 | geo_dropdown = dcc.Dropdown(options=avocado['geography'].unique(), 17 | value='New York') 18 | 19 | app.layout = html.Div(children=[ 20 | html.H1(children='Avocado Prices Dashboard'), 21 | geo_dropdown, 22 | dcc.Graph(id='price-graph') 23 | ]) 24 | 25 | 26 | # Step 4: Adding the callback function 27 | @app.callback( 28 | Output(component_id='price-graph', component_property='figure'), 29 | Input(component_id=geo_dropdown, component_property='value') 30 | ) 31 | def update_graph(selected_geography): 32 | filtered_avocado = avocado[avocado['geography'] == selected_geography] 33 | line_fig = px.line(filtered_avocado, 34 | x='date', y='average_price', 35 | color='type', 36 | title=f'Avocado Prices in {selected_geography}') 37 | return line_fig 38 | 39 | 40 | # Step 5: Running the dashboard 41 | if __name__ == '__main__': 42 | app.run_server(debug=True) 43 | -------------------------------------------------------------------------------- /building_a_deck_of_cards.py: -------------------------------------------------------------------------------- 1 | from dash import Dash, html 2 | import dash_bootstrap_components as dbc 3 | import pandas as pd 4 | 5 | soccer = pd.read_csv('fifa_soccer_players.csv') 6 | 7 | 8 | avg_age = soccer['age'].mean() 9 | avg_height = soccer['height_cm'].mean() 10 | avg_weight = soccer['weight_kg'].mean() 11 | sofifa_logo = 'https://uptime.com/media/website_profiles/sofifa.com.png' 12 | 13 | navbar = dbc.NavbarSimple( 14 | brand='Soccer Players Dashboard', 15 | children=[ 16 | html.Img(src=sofifa_logo, height=20), 17 | html.A('Data Source', 18 | href='https://sofifa.com/', 19 | target='_blank', 20 | style={'color': 'black'}) 21 | ], 22 | color='primary', 23 | fluid=True 24 | ) 25 | 26 | cards = dbc.Row([ 27 | dbc.Col( 28 | dbc.Card([ 29 | html.H4('Avg. Age'), 30 | html.H5(f'{round(avg_age, 1)} years') 31 | ], 32 | body=True, 33 | style={'textAlign': 'center', 'color': 'white'}, 34 | color='lightblue' 35 | ) 36 | ), 37 | dbc.Col( 38 | dbc.Card([ 39 | html.H4('Avg. Height'), 40 | html.H5(f'{round(avg_height, 1)} cm') 41 | ], 42 | body=True, 43 | style={'textAlign': 'center', 'color': 'white'}, 44 | color='blue' 45 | ) 46 | ), 47 | dbc.Col( 48 | dbc.Card([ 49 | html.H4('Avg. Weight'), 50 | html.H5(f'{round(avg_weight, 1)} kg') 51 | ], 52 | body=True, 53 | style={'textAlign': 'center', 'color': 'white'}, 54 | color='darkblue' 55 | ) 56 | ) 57 | ]) 58 | 59 | app = Dash(external_stylesheets=[dbc.themes.BOOTSTRAP]) 60 | 61 | app.layout = html.Div([navbar, html.Br(), cards]) 62 | 63 | if __name__ == '__main__': 64 | app.run_server(debug=True) 65 | -------------------------------------------------------------------------------- /building_a_navigation_bar.py: -------------------------------------------------------------------------------- 1 | from dash import Dash, html 2 | import dash_bootstrap_components as dbc 3 | 4 | sofifa_logo = 'https://uptime.com/media/website_profiles/sofifa.com.png' 5 | 6 | navbar = dbc.NavbarSimple( 7 | brand='Soccer Players Dashboard', 8 | children=[ 9 | html.Img(src=sofifa_logo, height=20), 10 | html.A('Data Source', 11 | href='https://sofifa.com/', 12 | target='_blank', 13 | style={'color': 'black'}) 14 | ], 15 | color='primary', 16 | fluid=True 17 | ) 18 | 19 | app = Dash(external_stylesheets=[dbc.themes.BOOTSTRAP]) 20 | 21 | app.layout = html.Div(navbar) 22 | 23 | if __name__ == '__main__': 24 | app.run_server(debug=True) 25 | -------------------------------------------------------------------------------- /building_callbacks_with_multiple_inputs_outputs.py: -------------------------------------------------------------------------------- 1 | from dash import Dash, html, dcc, Input, Output 2 | import pandas as pd 3 | import plotly.express as px 4 | 5 | happiness = pd.read_csv('world_happiness.csv') 6 | 7 | 8 | app = Dash() 9 | 10 | app.layout = html.Div([ 11 | html.H1('World Happiness Dashboard'), 12 | html.P(['This dashboard shows the happiness score.', 13 | html.Br(), 14 | html.A('World Happiness Report Data Source', 15 | href='https://worldhappiness.report/', 16 | target='_blank')]), 17 | dcc.Dropdown(id='country-dropdown', 18 | options=happiness['country'].unique(), 19 | value='United States'), 20 | dcc.RadioItems(id='data-radio', 21 | options={ 22 | 'happiness_score': 'Happiness Score', 23 | 'happiness_rank': 'Happiness Rank' 24 | }, 25 | value='happiness_score'), 26 | dcc.Graph(id='happiness-graph'), 27 | html.Div(id='average-div')]) 28 | 29 | 30 | @app.callback( 31 | Output('happiness-graph', 'figure'), 32 | Output('average-div', 'children'), 33 | Input('country-dropdown', 'value'), 34 | Input('data-radio', 'value')) 35 | def update_graph(selected_country, selected_data): 36 | filtered_happiness = happiness[happiness['country'] == selected_country] 37 | line_fig = px.line(filtered_happiness, 38 | x='year', y=selected_data, 39 | title=f'{selected_data} in {selected_country}') 40 | selected_avg = filtered_happiness[selected_data].mean() 41 | return line_fig, f'The average {selected_data} for {selected_country} is {selected_avg}' 42 | 43 | 44 | if __name__ == '__main__': 45 | app.run_server(debug=True) 46 | -------------------------------------------------------------------------------- /building_callbacks_with_single_input_output.py: -------------------------------------------------------------------------------- 1 | from dash import Dash, html, dcc, Input, Output 2 | 3 | app = Dash() 4 | 5 | app.layout = html.Div([ 6 | dcc.Input(id='input-text', value='Change this text', type='text'), 7 | html.Div(children='', id='output-text') 8 | ]) 9 | 10 | 11 | @app.callback( 12 | Output(component_id='output-text', component_property='children'), 13 | Input(component_id='input-text', component_property='value') 14 | ) 15 | def update_output_div(input_text): 16 | return f'Text: {input_text}' 17 | 18 | 19 | if __name__ == '__main__': 20 | app.run_server(debug=True) 21 | -------------------------------------------------------------------------------- /building_callbacks_with_single_input_output_without_id.py: -------------------------------------------------------------------------------- 1 | from dash import Dash, html, dcc, Input, Output 2 | 3 | app = Dash() 4 | 5 | input_text = dcc.Input(value='Change this text', type='text') 6 | output_text = html.Div() 7 | 8 | app.layout = html.Div([input_text, output_text]) 9 | 10 | 11 | @app.callback( 12 | Output(component_id=output_text, component_property='children'), 13 | Input(component_id=input_text, component_property='value') 14 | ) 15 | def update_output_div(input_text): 16 | return f'Text: {input_text}' 17 | 18 | 19 | if __name__ == '__main__': 20 | app.run_server(debug=True) 21 | -------------------------------------------------------------------------------- /chaining_callbacks_inputs_and_outputs.py: -------------------------------------------------------------------------------- 1 | from dash import Dash, html, dcc, Input, Output 2 | import pandas as pd 3 | import plotly.express as px 4 | 5 | happiness = pd.read_csv('world_happiness.csv') 6 | 7 | 8 | app = Dash() 9 | 10 | app.layout = html.Div([ 11 | html.H1('World Happiness Dashboard'), 12 | html.P(['This dashboard shows the happiness score.', 13 | html.Br(), 14 | html.A('World Happiness Report Data Source', 15 | href='https://worldhappiness.report/', 16 | target='_blank')]), 17 | dcc.RadioItems(id='region-radio', 18 | options=happiness['region'].unique(), 19 | value='North America'), 20 | dcc.Dropdown(id='country-dropdown', 21 | options=[], 22 | value=''), 23 | dcc.RadioItems(id='data-radio', 24 | options={ 25 | 'happiness_score': 'Happiness Score', 26 | 'happiness_rank': 'Happiness Rank' 27 | }, 28 | value='happiness_score'), 29 | dcc.Graph(id='happiness-graph'), 30 | html.Div(id='average-div')]) 31 | 32 | 33 | @app.callback( 34 | Output('country-dropdown', 'options'), 35 | Output('country-dropdown', 'value'), 36 | Input('region-radio', 'value')) 37 | def update_dropdown(selected_region): 38 | filtered_happiness = happiness[happiness['region'] == selected_region] 39 | country_options = filtered_happiness['country'].unique() 40 | return country_options, country_options[0] 41 | 42 | 43 | @app.callback( 44 | Output('happiness-graph', 'figure'), 45 | Output('average-div', 'children'), 46 | Input('country-dropdown', 'value'), 47 | Input('data-radio', 'value')) 48 | def update_graph(selected_country, selected_data): 49 | filtered_happiness = happiness[happiness['country'] == selected_country] 50 | line_fig = px.line(filtered_happiness, 51 | x='year', y=selected_data, 52 | title=f'{selected_data} in {selected_country}') 53 | selected_avg = filtered_happiness[selected_data].mean() 54 | return line_fig, f'The average {selected_data} for {selected_country} is {selected_avg}' 55 | 56 | 57 | if __name__ == '__main__': 58 | app.run_server(debug=True) 59 | -------------------------------------------------------------------------------- /controlling_callbacks_with_states_button.py: -------------------------------------------------------------------------------- 1 | from dash import Dash, html, dcc, Input, Output, State 2 | import pandas as pd 3 | import plotly.express as px 4 | 5 | happiness = pd.read_csv('world_happiness.csv') 6 | 7 | 8 | app = Dash() 9 | 10 | app.layout = html.Div([ 11 | html.H1('World Happiness Dashboard'), 12 | html.P(['This dashboard shows the happiness score.', 13 | html.Br(), 14 | html.A('World Happiness Report Data Source', 15 | href='https://worldhappiness.report/', 16 | target='_blank')]), 17 | dcc.RadioItems(id='region-radio', 18 | options=happiness['region'].unique(), 19 | value='North America'), 20 | dcc.Dropdown(id='country-dropdown'), 21 | dcc.RadioItems(id='data-radio', 22 | options={ 23 | 'happiness_score': 'Happiness Score', 24 | 'happiness_rank': 'Happiness Rank' 25 | }, 26 | value='happiness_score'), 27 | html.Br(), 28 | html.Button(id='submit-button', 29 | n_clicks=0, 30 | children='Update the Output'), 31 | dcc.Graph(id='happiness-graph'), 32 | html.Div(id='average-div')]) 33 | 34 | 35 | @app.callback( 36 | Output('country-dropdown', 'options'), 37 | Output('country-dropdown', 'value'), 38 | Input('region-radio', 'value')) 39 | def update_dropdown(selected_region): 40 | filtered_happiness = happiness[happiness['region'] == selected_region] 41 | country_options = filtered_happiness['country'].unique() 42 | return country_options, country_options[0] 43 | 44 | 45 | @app.callback( 46 | Output('happiness-graph', 'figure'), 47 | Output('average-div', 'children'), 48 | Input('submit-button', 'n_clicks'), 49 | State('country-dropdown', 'value'), 50 | State('data-radio', 'value')) 51 | def update_graph(button_click, selected_country, selected_data): 52 | filtered_happiness = happiness[happiness['country'] == selected_country] 53 | line_fig = px.line(filtered_happiness, 54 | x='year', y=selected_data, 55 | title=f'{selected_data} in {selected_country}') 56 | selected_avg = filtered_happiness[selected_data].mean() 57 | return line_fig, f'The average {selected_data} for {selected_country} is {selected_avg}' 58 | 59 | 60 | if __name__ == '__main__': 61 | app.run_server(debug=True) 62 | -------------------------------------------------------------------------------- /core_components_overview.py: -------------------------------------------------------------------------------- 1 | from dash import Dash, html, dcc 2 | import pandas as pd 3 | import plotly.express as px 4 | 5 | happiness = pd.read_csv('world_happiness.csv') 6 | 7 | line_fig = px.line(happiness[happiness['country'] == 'United States'], 8 | x='year', y='happiness_score', 9 | title='Happiness Score in the USA') 10 | 11 | app = Dash() 12 | 13 | app.layout = html.Div([ 14 | html.H1('World Happiness Dashboard'), 15 | html.P(['This dashboard shows the happiness score.', 16 | html.Br(), 17 | html.A('World Happiness Report Data Source', 18 | href='https://worldhappiness.report/', 19 | target='_blank')]), 20 | dcc.RadioItems(options=happiness['region'].unique(), value='North America'), 21 | dcc.Checklist(options=happiness['region'].unique(), value=['North America']), 22 | dcc.Dropdown(options=happiness['country'].unique(), value='United States'), 23 | dcc.Graph(figure=line_fig)]) 24 | 25 | if __name__ == '__main__': 26 | app.run_server(debug=True) 27 | -------------------------------------------------------------------------------- /creating_a_grid_layout.py: -------------------------------------------------------------------------------- 1 | from dash import Dash, html, dcc 2 | import dash_bootstrap_components as dbc 3 | import pandas as pd 4 | 5 | soccer = pd.read_csv('fifa_soccer_players.csv') 6 | 7 | 8 | app = Dash(external_stylesheets=[dbc.themes.CYBORG]) 9 | 10 | app.layout = html.Div([ 11 | html.H1('Soccer Players Dashboard'), 12 | dbc.Row([ 13 | dbc.Col( 14 | html.P(['Source: ', 15 | html.A('Sofifa', 16 | href='https://sofifa.com/', 17 | target='_blank') 18 | ]) 19 | ), 20 | dbc.Col([ 21 | html.Label('Player name: '), 22 | dcc.Dropdown( 23 | options=soccer['long_name'].unique(), 24 | value=soccer['long_name'].unique()[0]) 25 | ]) 26 | ]) 27 | ]) 28 | 29 | if __name__ == '__main__': 30 | app.run_server(debug=True) 31 | -------------------------------------------------------------------------------- /creating_interactive_plotly_figures.py: -------------------------------------------------------------------------------- 1 | from dash import Dash, html, dcc, Input, Output 2 | import pandas as pd 3 | import plotly.express as px 4 | 5 | happiness = pd.read_csv('world_happiness.csv') 6 | 7 | 8 | app = Dash() 9 | 10 | app.layout = html.Div([ 11 | html.H1('World Happiness Dashboard'), 12 | html.P(['This dashboard shows the happiness score.', 13 | html.Br(), 14 | html.A('World Happiness Report Data Source', 15 | href='https://worldhappiness.report/', 16 | target='_blank')]), 17 | dcc.Dropdown(id='country-dropdown', 18 | options=happiness['country'].unique(), 19 | value='United States'), 20 | dcc.Graph(id='happiness-graph', figure={})]) 21 | 22 | 23 | @app.callback( 24 | Output(component_id='happiness-graph', component_property='figure'), 25 | Input(component_id='country-dropdown', component_property='value')) 26 | def update_graph(selected_country): 27 | filtered_happiness = happiness[happiness['country'] == selected_country] 28 | line_fig = px.line(filtered_happiness, 29 | x='year', y='happiness_score', 30 | title=f'Happiness Score in {selected_country}') 31 | return line_fig 32 | 33 | 34 | if __name__ == '__main__': 35 | app.run_server(debug=True) 36 | -------------------------------------------------------------------------------- /creating_your_first_dashboard.py: -------------------------------------------------------------------------------- 1 | from dash import Dash, html 2 | 3 | app = Dash() 4 | 5 | app.layout = html.Div('My Dashboard') 6 | 7 | if __name__ == '__main__': 8 | app.run_server(debug=True) 9 | -------------------------------------------------------------------------------- /customizing_with_external_css.py: -------------------------------------------------------------------------------- 1 | from dash import Dash, html, dcc 2 | import dash_bootstrap_components as dbc 3 | import pandas as pd 4 | 5 | soccer = pd.read_csv('fifa_soccer_players.csv') 6 | 7 | 8 | app = Dash(external_stylesheets=[dbc.themes.CYBORG]) 9 | 10 | app.layout = html.Div([ 11 | html.H1('Soccer Players Dashboard'), 12 | html.P(['Source: ', 13 | html.A('Sofifa', 14 | href='https://sofifa.com/', 15 | target='_blank')]), 16 | html.Label('Player name: '), 17 | dcc.Dropdown( 18 | options=soccer['long_name'].unique(), 19 | value=soccer['long_name'].unique()[0]) 20 | ]) 21 | 22 | if __name__ == '__main__': 23 | app.run_server(debug=True) 24 | -------------------------------------------------------------------------------- /customizing_with_inline_css.py: -------------------------------------------------------------------------------- 1 | from dash import Dash, html, dcc 2 | import pandas as pd 3 | 4 | soccer = pd.read_csv('fifa_soccer_players.csv') 5 | 6 | 7 | app = Dash() 8 | 9 | app.layout = html.Div([ 10 | html.H1('Soccer Players Dashboard', 11 | style={'textAlign': 'center', 12 | 'fontFamily': 'fantasy', 13 | 'fontSize': 50, 14 | 'color': 'blue'}), 15 | html.P(['Source: ', 16 | html.A('Sofifa', 17 | href='https://sofifa.com/', 18 | target='_blank')], 19 | style={'border': 'solid'}), 20 | html.Label('Player name: '), 21 | dcc.Dropdown( 22 | options=soccer['long_name'].unique(), value=soccer['long_name'].unique()[0], 23 | style={'backgroundColor': 'lightblue'})], 24 | style={'padding': 100, 'border': 'solid'}) 25 | 26 | if __name__ == '__main__': 27 | app.run_server(debug=True) 28 | -------------------------------------------------------------------------------- /electricity.csv: -------------------------------------------------------------------------------- 1 | Year,US_State,Residential Price 2 | 2019,AK,22.92 3 | 2019,AL,12.53 4 | 2019,AR,9.8 5 | 2019,AZ,12.43 6 | 2019,CA,19.15 7 | 2019,CO,12.18 8 | 2019,CT,21.87 9 | 2019,DC,12.98 10 | 2019,DE,12.55 11 | 2019,FL,11.7 12 | 2019,GA,11.76 13 | 2019,HI,32.06 14 | 2019,IA,12.46 15 | 2019,ID,9.89 16 | 2019,IL,13.03 17 | 2019,IN,12.58 18 | 2019,KS,12.71 19 | 2019,KY,10.8 20 | 2019,LA,9.8 21 | 2019,MA,21.92 22 | 2019,MD,13.12 23 | 2019,ME,17.89 24 | 2019,MI,15.74 25 | 2019,MN,13.04 26 | 2019,MO,11.14 27 | 2019,MS,11.27 28 | 2019,MT,11.13 29 | 2019,NC,11.42 30 | 2019,ND,10.3 31 | 2019,NE,10.77 32 | 2019,NH,20.05 33 | 2019,NJ,15.85 34 | 2019,NM,12.51 35 | 2019,NV,12 36 | 2019,NY,17.94 37 | 2019,OH,12.38 38 | 2019,OK,10.21 39 | 2019,OR,11.01 40 | 2019,PA,13.8 41 | 2019,RI,21.73 42 | 2019,SC,12.99 43 | 2019,SD,11.55 44 | 2019,TN,10.87 45 | 2019,TX,11.76 46 | 2019,UT,10.4 47 | 2019,VA,12.07 48 | 2019,VT,17.71 49 | 2019,WA,9.71 50 | 2019,WI,14.18 51 | 2019,WV,11.25 52 | 2019,WY,11.18 53 | 2018,AK,21.94 54 | 2018,AL,12.18 55 | 2018,AR,9.81 56 | 2018,AZ,12.77 57 | 2018,CA,18.84 58 | 2018,CO,12.15 59 | 2018,CT,21.2 60 | 2018,DC,12.84 61 | 2018,DE,12.53 62 | 2018,FL,11.54 63 | 2018,GA,11.47 64 | 2018,HI,32.47 65 | 2018,IA,12.24 66 | 2018,ID,10.15 67 | 2018,IL,12.77 68 | 2018,IN,12.26 69 | 2018,KS,13.35 70 | 2018,KY,10.6 71 | 2018,LA,9.59 72 | 2018,MA,21.61 73 | 2018,MD,13.3 74 | 2018,ME,16.84 75 | 2018,MI,15.45 76 | 2018,MN,13.14 77 | 2018,MO,11.34 78 | 2018,MS,11.12 79 | 2018,MT,10.96 80 | 2018,NC,11.09 81 | 2018,ND,10.25 82 | 2018,NE,10.7 83 | 2018,NH,19.69 84 | 2018,NJ,15.41 85 | 2018,NM,12.68 86 | 2018,NV,11.85 87 | 2018,NY,18.52 88 | 2018,OH,12.56 89 | 2018,OK,10.3 90 | 2018,OR,10.98 91 | 2018,PA,13.89 92 | 2018,RI,20.55 93 | 2018,SC,12.44 94 | 2018,SD,11.59 95 | 2018,TN,10.71 96 | 2018,TX,11.2 97 | 2018,UT,10.41 98 | 2018,VA,11.73 99 | 2018,VT,18.02 100 | 2018,WA,9.75 101 | 2018,WI,14.02 102 | 2018,WV,11.18 103 | 2018,WY,11.29 104 | 2017,AK,21.27 105 | 2017,AL,12.55 106 | 2017,AR,10.28 107 | 2017,AZ,12.44 108 | 2017,CA,18.31 109 | 2017,CO,12.17 110 | 2017,CT,20.29 111 | 2017,DC,12.94 112 | 2017,DE,13.35 113 | 2017,FL,11.61 114 | 2017,GA,11.9 115 | 2017,HI,29.5 116 | 2017,IA,12.34 117 | 2017,ID,10.04 118 | 2017,IL,12.95 119 | 2017,IN,12.29 120 | 2017,KS,13.31 121 | 2017,KY,10.85 122 | 2017,LA,9.74 123 | 2017,MA,20.06 124 | 2017,MD,13.96 125 | 2017,ME,15.97 126 | 2017,MI,15.4 127 | 2017,MN,13.04 128 | 2017,MO,11.63 129 | 2017,MS,11.08 130 | 2017,MT,10.95 131 | 2017,NC,10.94 132 | 2017,ND,10.29 133 | 2017,NE,10.97 134 | 2017,NH,19.2 135 | 2017,NJ,15.65 136 | 2017,NM,12.88 137 | 2017,NV,11.99 138 | 2017,NY,18.03 139 | 2017,OH,12.63 140 | 2017,OK,10.61 141 | 2017,OR,10.66 142 | 2017,PA,14.23 143 | 2017,RI,18.32 144 | 2017,SC,13.02 145 | 2017,SD,11.77 146 | 2017,TN,10.72 147 | 2017,TX,11.01 148 | 2017,UT,10.95 149 | 2017,VA,11.55 150 | 2017,VT,17.68 151 | 2017,WA,9.66 152 | 2017,WI,14.35 153 | 2017,WV,11.63 154 | 2017,WY,11.37 155 | 2016,AK,20.3 156 | 2016,AL,11.99 157 | 2016,AR,9.92 158 | 2016,AZ,12.15 159 | 2016,CA,17.39 160 | 2016,CO,12.07 161 | 2016,CT,20.01 162 | 2016,DC,12.29 163 | 2016,DE,13.42 164 | 2016,FL,10.98 165 | 2016,GA,11.5 166 | 2016,HI,27.47 167 | 2016,IA,11.94 168 | 2016,ID,9.95 169 | 2016,IL,12.54 170 | 2016,IN,11.79 171 | 2016,KS,13.06 172 | 2016,KY,10.49 173 | 2016,LA,9.34 174 | 2016,MA,19 175 | 2016,MD,14.23 176 | 2016,ME,15.83 177 | 2016,MI,15.22 178 | 2016,MN,12.67 179 | 2016,MO,11.21 180 | 2016,MS,10.47 181 | 2016,MT,10.94 182 | 2016,NC,11.03 183 | 2016,ND,10.16 184 | 2016,NE,10.84 185 | 2016,NH,18.38 186 | 2016,NJ,15.72 187 | 2016,NM,12.03 188 | 2016,NV,11.41 189 | 2016,NY,17.58 190 | 2016,OH,12.47 191 | 2016,OK,10.2 192 | 2016,OR,10.66 193 | 2016,PA,13.86 194 | 2016,RI,18.62 195 | 2016,SC,12.65 196 | 2016,SD,11.47 197 | 2016,TN,10.41 198 | 2016,TX,10.99 199 | 2016,UT,11.02 200 | 2016,VA,11.36 201 | 2016,VT,17.37 202 | 2016,WA,9.48 203 | 2016,WI,14.07 204 | 2016,WV,11.44 205 | 2016,WY,11.13 206 | 2015,AK,19.83 207 | 2015,AL,11.7 208 | 2015,AR,9.82 209 | 2015,AZ,12.13 210 | 2015,CA,16.99 211 | 2015,CO,12.12 212 | 2015,CT,20.94 213 | 2015,DC,12.99 214 | 2015,DE,13.42 215 | 2015,FL,11.58 216 | 2015,GA,11.54 217 | 2015,HI,29.6 218 | 2015,IA,11.63 219 | 2015,ID,9.93 220 | 2015,IL,12.5 221 | 2015,IN,11.57 222 | 2015,KS,12.34 223 | 2015,KY,10.24 224 | 2015,LA,9.33 225 | 2015,MA,19.83 226 | 2015,MD,13.82 227 | 2015,ME,15.61 228 | 2015,MI,14.42 229 | 2015,MN,12.12 230 | 2015,MO,11.21 231 | 2015,MS,11.27 232 | 2015,MT,10.88 233 | 2015,NC,11.28 234 | 2015,ND,9.62 235 | 2015,NE,10.6 236 | 2015,NH,18.5 237 | 2015,NJ,15.81 238 | 2015,NM,12.47 239 | 2015,NV,12.76 240 | 2015,NY,18.54 241 | 2015,OH,12.8 242 | 2015,OK,10.14 243 | 2015,OR,10.66 244 | 2015,PA,13.64 245 | 2015,RI,19.29 246 | 2015,SC,12.57 247 | 2015,SD,11.08 248 | 2015,TN,10.3 249 | 2015,TX,11.56 250 | 2015,UT,10.88 251 | 2015,VA,11.37 252 | 2015,VT,17.09 253 | 2015,WA,9.09 254 | 2015,WI,14.11 255 | 2015,WV,10.08 256 | 2015,WY,10.97 257 | 2014,AK,19.14 258 | 2014,AL,11.48 259 | 2014,AR,9.51 260 | 2014,AZ,11.9 261 | 2014,CA,16.25 262 | 2014,CO,12.18 263 | 2014,CT,19.75 264 | 2014,DC,12.74 265 | 2014,DE,13.29 266 | 2014,FL,11.89 267 | 2014,GA,11.65 268 | 2014,HI,37.04 269 | 2014,IA,11.16 270 | 2014,ID,9.72 271 | 2014,IL,11.91 272 | 2014,IN,11.46 273 | 2014,KS,12.17 274 | 2014,KY,10.16 275 | 2014,LA,9.57 276 | 2014,MA,17.39 277 | 2014,MD,13.63 278 | 2014,ME,15.27 279 | 2014,MI,14.46 280 | 2014,MN,12.01 281 | 2014,MO,10.64 282 | 2014,MS,11.32 283 | 2014,MT,10.18 284 | 2014,NC,11.1 285 | 2014,ND,9.15 286 | 2014,NE,10.4 287 | 2014,NH,17.53 288 | 2014,NJ,15.78 289 | 2014,NM,12.28 290 | 2014,NV,12.93 291 | 2014,NY,20.07 292 | 2014,OH,12.5 293 | 2014,OK,10.03 294 | 2014,OR,10.47 295 | 2014,PA,13.32 296 | 2014,RI,17.17 297 | 2014,SC,12.45 298 | 2014,SD,10.47 299 | 2014,TN,10.32 300 | 2014,TX,11.86 301 | 2014,UT,10.65 302 | 2014,VA,11.1 303 | 2014,VT,17.47 304 | 2014,WA,8.67 305 | 2014,WI,13.67 306 | 2014,WV,9.34 307 | 2014,WY,10.5 308 | 2013,AK,18.12 309 | 2013,AL,11.26 310 | 2013,AR,9.59 311 | 2013,AZ,11.71 312 | 2013,CA,16.23 313 | 2013,CO,11.93 314 | 2013,CT,17.55 315 | 2013,DC,12.57 316 | 2013,DE,12.95 317 | 2013,FL,11.27 318 | 2013,GA,11.46 319 | 2013,HI,36.98 320 | 2013,IA,11.04 321 | 2013,ID,9.32 322 | 2013,IL,10.63 323 | 2013,IN,10.99 324 | 2013,KS,11.64 325 | 2013,KY,9.79 326 | 2013,LA,9.43 327 | 2013,MA,15.83 328 | 2013,MD,13.25 329 | 2013,ME,14.35 330 | 2013,MI,14.59 331 | 2013,MN,11.81 332 | 2013,MO,10.6 333 | 2013,MS,10.78 334 | 2013,MT,10.33 335 | 2013,NC,10.97 336 | 2013,ND,9.12 337 | 2013,NE,10.31 338 | 2013,NH,16.33 339 | 2013,NJ,15.73 340 | 2013,NM,11.68 341 | 2013,NV,11.89 342 | 2013,NY,18.79 343 | 2013,OH,12.01 344 | 2013,OK,9.67 345 | 2013,OR,9.9 346 | 2013,PA,12.79 347 | 2013,RI,15.2 348 | 2013,SC,11.99 349 | 2013,SD,10.26 350 | 2013,TN,9.98 351 | 2013,TX,11.35 352 | 2013,UT,10.37 353 | 2013,VA,10.84 354 | 2013,VT,17.14 355 | 2013,WA,8.7 356 | 2013,WI,13.55 357 | 2013,WV,9.52 358 | 2013,WY,10.16 359 | 2012,AK,17.88 360 | 2012,AL,11.4 361 | 2012,AR,9.3 362 | 2012,AZ,11.29 363 | 2012,CA,15.34 364 | 2012,CO,11.46 365 | 2012,CT,17.34 366 | 2012,DC,12.28 367 | 2012,DE,13.58 368 | 2012,FL,11.42 369 | 2012,GA,11.17 370 | 2012,HI,37.34 371 | 2012,IA,10.82 372 | 2012,ID,8.67 373 | 2012,IL,11.38 374 | 2012,IN,10.53 375 | 2012,KS,11.24 376 | 2012,KY,9.43 377 | 2012,LA,8.37 378 | 2012,MA,14.91 379 | 2012,MD,12.84 380 | 2012,ME,14.66 381 | 2012,MI,14.13 382 | 2012,MN,11.35 383 | 2012,MO,10.17 384 | 2012,MS,10.26 385 | 2012,MT,10.08 386 | 2012,NC,10.91 387 | 2012,ND,9.06 388 | 2012,NE,10.04 389 | 2012,NH,16.07 390 | 2012,NJ,15.78 391 | 2012,NM,11.38 392 | 2012,NV,11.83 393 | 2012,NY,17.62 394 | 2012,OH,11.76 395 | 2012,OK,9.51 396 | 2012,OR,9.8 397 | 2012,PA,12.75 398 | 2012,RI,14.4 399 | 2012,SC,11.77 400 | 2012,SD,10.07 401 | 2012,TN,10.1 402 | 2012,TX,10.98 403 | 2012,UT,9.93 404 | 2012,VA,11.08 405 | 2012,VT,17.01 406 | 2012,WA,8.53 407 | 2012,WI,13.19 408 | 2012,WV,9.85 409 | 2012,WY,9.85 410 | 2011,AK,17.62 411 | 2011,AL,11.09 412 | 2011,AR,9.02 413 | 2011,AZ,11.08 414 | 2011,CA,14.78 415 | 2011,CO,11.27 416 | 2011,CT,18.11 417 | 2011,DC,13.4 418 | 2011,DE,13.7 419 | 2011,FL,11.51 420 | 2011,GA,11.05 421 | 2011,HI,34.68 422 | 2011,IA,10.46 423 | 2011,ID,7.87 424 | 2011,IL,11.78 425 | 2011,IN,10.06 426 | 2011,KS,10.65 427 | 2011,KY,9.2 428 | 2011,LA,8.96 429 | 2011,MA,14.67 430 | 2011,MD,13.31 431 | 2011,ME,15.38 432 | 2011,MI,13.27 433 | 2011,MN,10.96 434 | 2011,MO,9.75 435 | 2011,MS,10.17 436 | 2011,MT,9.75 437 | 2011,NC,10.26 438 | 2011,ND,8.58 439 | 2011,NE,9.32 440 | 2011,NH,16.52 441 | 2011,NJ,16.23 442 | 2011,NM,11 443 | 2011,NV,11.61 444 | 2011,NY,18.26 445 | 2011,OH,11.42 446 | 2011,OK,9.47 447 | 2011,OR,9.54 448 | 2011,PA,13.26 449 | 2011,RI,14.33 450 | 2011,SC,11.05 451 | 2011,SD,9.35 452 | 2011,TN,9.98 453 | 2011,TX,11.08 454 | 2011,UT,8.96 455 | 2011,VA,10.64 456 | 2011,VT,16.26 457 | 2011,WA,8.28 458 | 2011,WI,13.02 459 | 2011,WV,9.39 460 | 2011,WY,9.11 461 | 2010,AK,16.26 462 | 2010,AL,10.67 463 | 2010,AR,8.86 464 | 2010,AZ,10.97 465 | 2010,CA,14.75 466 | 2010,CO,11.04 467 | 2010,CT,19.25 468 | 2010,DC,14.01 469 | 2010,DE,13.8 470 | 2010,FL,11.44 471 | 2010,GA,10.07 472 | 2010,HI,28.1 473 | 2010,IA,10.42 474 | 2010,ID,7.99 475 | 2010,IL,11.52 476 | 2010,IN,9.56 477 | 2010,KS,10.03 478 | 2010,KY,8.57 479 | 2010,LA,8.98 480 | 2010,MA,14.59 481 | 2010,MD,14.32 482 | 2010,ME,15.72 483 | 2010,MI,12.46 484 | 2010,MN,10.59 485 | 2010,MO,9.08 486 | 2010,MS,9.87 487 | 2010,MT,9.16 488 | 2010,NC,10.12 489 | 2010,ND,8.13 490 | 2010,NE,8.94 491 | 2010,NH,16.32 492 | 2010,NJ,16.57 493 | 2010,NM,10.52 494 | 2010,NV,12.36 495 | 2010,NY,18.74 496 | 2010,OH,11.31 497 | 2010,OK,9.14 498 | 2010,OR,8.87 499 | 2010,PA,12.7 500 | 2010,RI,15.92 501 | 2010,SC,10.5 502 | 2010,SD,8.97 503 | 2010,TN,9.23 504 | 2010,TX,11.6 505 | 2010,UT,8.71 506 | 2010,VA,10.45 507 | 2010,VT,15.57 508 | 2010,WA,8.04 509 | 2010,WI,12.65 510 | 2010,WV,8.79 511 | 2010,WY,8.77 512 | 2009,AK,17.14 513 | 2009,AL,10.66 514 | 2009,AR,9.14 515 | 2009,AZ,10.73 516 | 2009,CA,14.74 517 | 2009,CO,10 518 | 2009,CT,20.33 519 | 2009,DC,13.73 520 | 2009,DE,14.07 521 | 2009,FL,12.39 522 | 2009,GA,10.13 523 | 2009,HI,24.2 524 | 2009,IA,9.99 525 | 2009,ID,7.8 526 | 2009,IL,11.27 527 | 2009,IN,9.5 528 | 2009,KS,9.53 529 | 2009,KY,8.37 530 | 2009,LA,8.1 531 | 2009,MA,16.87 532 | 2009,MD,14.98 533 | 2009,ME,15.64 534 | 2009,MI,11.6 535 | 2009,MN,10.04 536 | 2009,MO,8.54 537 | 2009,MS,10.22 538 | 2009,MT,8.94 539 | 2009,NC,9.99 540 | 2009,ND,7.58 541 | 2009,NE,8.52 542 | 2009,NH,16.39 543 | 2009,NJ,16.31 544 | 2009,NM,10.02 545 | 2009,NV,12.86 546 | 2009,NY,17.5 547 | 2009,OH,10.67 548 | 2009,OK,8.49 549 | 2009,OR,8.68 550 | 2009,PA,11.65 551 | 2009,RI,15.6 552 | 2009,SC,10.44 553 | 2009,SD,8.49 554 | 2009,TN,9.32 555 | 2009,TX,12.38 556 | 2009,UT,8.48 557 | 2009,VA,10.61 558 | 2009,VT,14.9 559 | 2009,WA,7.67 560 | 2009,WI,11.94 561 | 2009,WV,7.9 562 | 2009,WY,8.58 563 | 2008,AK,16.56 564 | 2008,AL,10.4 565 | 2008,AR,9.27 566 | 2008,AZ,10.27 567 | 2008,CA,13.81 568 | 2008,CO,10.13 569 | 2008,CT,19.54 570 | 2008,DC,12.78 571 | 2008,DE,13.93 572 | 2008,FL,11.65 573 | 2008,GA,9.93 574 | 2008,HI,32.5 575 | 2008,IA,9.49 576 | 2008,ID,6.99 577 | 2008,IL,11.07 578 | 2008,IN,8.87 579 | 2008,KS,8.89 580 | 2008,KY,7.94 581 | 2008,LA,10.28 582 | 2008,MA,17.56 583 | 2008,MD,13.84 584 | 2008,ME,16.24 585 | 2008,MI,10.75 586 | 2008,MN,9.74 587 | 2008,MO,8 588 | 2008,MS,10.39 589 | 2008,MT,9.13 590 | 2008,NC,9.52 591 | 2008,ND,7.52 592 | 2008,NE,7.87 593 | 2008,NH,15.68 594 | 2008,NJ,15.66 595 | 2008,NM,10.01 596 | 2008,NV,11.93 597 | 2008,NY,18.31 598 | 2008,OH,10.06 599 | 2008,OK,9.09 600 | 2008,OR,8.49 601 | 2008,PA,11.35 602 | 2008,RI,17.45 603 | 2008,SC,9.89 604 | 2008,SD,8.27 605 | 2008,TN,8.91 606 | 2008,TX,13.03 607 | 2008,UT,8.26 608 | 2008,VA,9.62 609 | 2008,VT,14.48 610 | 2008,WA,7.54 611 | 2008,WI,11.51 612 | 2008,WV,7.06 613 | 2008,WY,8.21 614 | 2007,AK,15.18 615 | 2007,AL,9.32 616 | 2007,AR,8.73 617 | 2007,AZ,9.66 618 | 2007,CA,14.42 619 | 2007,CO,9.25 620 | 2007,CT,19.11 621 | 2007,DC,11.18 622 | 2007,DE,13.16 623 | 2007,FL,11.22 624 | 2007,GA,9.1 625 | 2007,HI,24.12 626 | 2007,IA,9.45 627 | 2007,ID,6.36 628 | 2007,IL,10.12 629 | 2007,IN,8.26 630 | 2007,KS,8.19 631 | 2007,KY,7.34 632 | 2007,LA,9.37 633 | 2007,MA,16.23 634 | 2007,MD,11.89 635 | 2007,ME,16.52 636 | 2007,MI,10.21 637 | 2007,MN,9.18 638 | 2007,MO,7.69 639 | 2007,MS,9.36 640 | 2007,MT,8.77 641 | 2007,NC,9.4 642 | 2007,ND,7.3 643 | 2007,NE,7.59 644 | 2007,NH,14.88 645 | 2007,NJ,14.14 646 | 2007,NM,9.12 647 | 2007,NV,11.82 648 | 2007,NY,17.1 649 | 2007,OH,9.57 650 | 2007,OK,8.58 651 | 2007,OR,8.19 652 | 2007,PA,10.95 653 | 2007,RI,14.05 654 | 2007,SC,9.19 655 | 2007,SD,8.07 656 | 2007,TN,7.84 657 | 2007,TX,12.34 658 | 2007,UT,8.15 659 | 2007,VA,8.74 660 | 2007,VT,14.15 661 | 2007,WA,7.26 662 | 2007,WI,10.87 663 | 2007,WV,6.73 664 | 2007,WY,7.75 665 | 2006,AK,14.83 666 | 2006,AL,8.75 667 | 2006,AR,8.85 668 | 2006,AZ,9.4 669 | 2006,CA,14.33 670 | 2006,CO,9.02 671 | 2006,CT,16.86 672 | 2006,DC,9.88 673 | 2006,DE,11.85 674 | 2006,FL,11.33 675 | 2006,GA,8.91 676 | 2006,HI,23.35 677 | 2006,IA,9.63 678 | 2006,ID,6.21 679 | 2006,IL,8.42 680 | 2006,IN,8.22 681 | 2006,KS,8.25 682 | 2006,KY,7.02 683 | 2006,LA,9.14 684 | 2006,MA,16.6 685 | 2006,MD,9.71 686 | 2006,ME,13.8 687 | 2006,MI,9.77 688 | 2006,MN,8.7 689 | 2006,MO,7.44 690 | 2006,MS,9.66 691 | 2006,MT,8.28 692 | 2006,NC,9.12 693 | 2006,ND,7.14 694 | 2006,NE,7.41 695 | 2006,NH,14.68 696 | 2006,NJ,12.84 697 | 2006,NM,9.06 698 | 2006,NV,11.08 699 | 2006,NY,16.89 700 | 2006,OH,9.34 701 | 2006,OK,8.55 702 | 2006,OR,7.48 703 | 2006,PA,10.35 704 | 2006,RI,15.12 705 | 2006,SC,9.03 706 | 2006,SD,7.83 707 | 2006,TN,7.75 708 | 2006,TX,12.86 709 | 2006,UT,7.59 710 | 2006,VA,8.49 711 | 2006,VT,13.39 712 | 2006,WA,6.82 713 | 2006,WI,10.51 714 | 2006,WV,6.35 715 | 2006,WY,7.75 716 | 2005,AK,13.3 717 | 2005,AL,8 718 | 2005,AR,8 719 | 2005,AZ,8.86 720 | 2005,CA,12.51 721 | 2005,CO,9.06 722 | 2005,CT,13.64 723 | 2005,DC,9.1 724 | 2005,DE,9.01 725 | 2005,FL,9.62 726 | 2005,GA,8.64 727 | 2005,HI,20.7 728 | 2005,IA,9.27 729 | 2005,ID,6.29 730 | 2005,IL,8.34 731 | 2005,IN,7.5 732 | 2005,KS,7.9 733 | 2005,KY,6.57 734 | 2005,LA,8.87 735 | 2005,MA,13.44 736 | 2005,MD,8.46 737 | 2005,ME,13.23 738 | 2005,MI,8.4 739 | 2005,MN,8.28 740 | 2005,MO,7.08 741 | 2005,MS,8.71 742 | 2005,MT,8.1 743 | 2005,NC,8.65 744 | 2005,ND,6.99 745 | 2005,NE,7.14 746 | 2005,NH,13.51 747 | 2005,NJ,11.74 748 | 2005,NM,9.13 749 | 2005,NV,10.2 750 | 2005,NY,15.72 751 | 2005,OH,8.51 752 | 2005,OK,7.95 753 | 2005,OR,7.25 754 | 2005,PA,9.86 755 | 2005,RI,13.04 756 | 2005,SC,8.67 757 | 2005,SD,7.77 758 | 2005,TN,6.98 759 | 2005,TX,10.93 760 | 2005,UT,7.52 761 | 2005,VA,8.16 762 | 2005,VT,12.96 763 | 2005,WA,6.54 764 | 2005,WI,9.66 765 | 2005,WV,6.21 766 | 2005,WY,7.48 767 | 2004,AK,12.44 768 | 2004,AL,7.62 769 | 2004,AR,7.36 770 | 2004,AZ,8.46 771 | 2004,CA,12.2 772 | 2004,CO,8.42 773 | 2004,CT,11.63 774 | 2004,DC,8 775 | 2004,DE,8.78 776 | 2004,FL,8.99 777 | 2004,GA,7.86 778 | 2004,HI,18.06 779 | 2004,IA,8.96 780 | 2004,ID,6.1 781 | 2004,IL,8.37 782 | 2004,IN,7.3 783 | 2004,KS,7.74 784 | 2004,KY,6.11 785 | 2004,LA,8.05 786 | 2004,MA,11.75 787 | 2004,MD,7.8 788 | 2004,ME,12.16 789 | 2004,MI,8.33 790 | 2004,MN,7.92 791 | 2004,MO,6.97 792 | 2004,MS,8.21 793 | 2004,MT,7.86 794 | 2004,NC,8.45 795 | 2004,ND,6.79 796 | 2004,NE,6.96 797 | 2004,NH,12.49 798 | 2004,NJ,11.23 799 | 2004,NM,8.67 800 | 2004,NV,9.69 801 | 2004,NY,14.54 802 | 2004,OH,8.45 803 | 2004,OK,7.72 804 | 2004,OR,7.18 805 | 2004,PA,9.58 806 | 2004,RI,12.19 807 | 2004,SC,8.12 808 | 2004,SD,7.65 809 | 2004,TN,6.9 810 | 2004,TX,9.73 811 | 2004,UT,7.21 812 | 2004,VA,7.99 813 | 2004,VT,12.94 814 | 2004,WA,6.37 815 | 2004,WI,9.07 816 | 2004,WV,6.23 817 | 2004,WY,7.21 818 | 2003,AK,11.98 819 | 2003,AL,7.39 820 | 2003,AR,7.24 821 | 2003,AZ,8.35 822 | 2003,CA,12.23 823 | 2003,CO,8.14 824 | 2003,CT,11.31 825 | 2003,DC,7.84 826 | 2003,DE,8.59 827 | 2003,FL,8.55 828 | 2003,GA,7.7 829 | 2003,HI,16.73 830 | 2003,IA,8.57 831 | 2003,ID,6.24 832 | 2003,IL,8.38 833 | 2003,IN,7.04 834 | 2003,KS,7.71 835 | 2003,KY,5.81 836 | 2003,LA,7.84 837 | 2003,MA,11.6 838 | 2003,MD,7.73 839 | 2003,ME,12.37 840 | 2003,MI,8.35 841 | 2003,MN,7.65 842 | 2003,MO,6.96 843 | 2003,MS,7.6 844 | 2003,MT,7.56 845 | 2003,NC,8.32 846 | 2003,ND,6.49 847 | 2003,NE,6.87 848 | 2003,NH,11.98 849 | 2003,NJ,10.67 850 | 2003,NM,8.69 851 | 2003,NV,9.02 852 | 2003,NY,14.31 853 | 2003,OH,8.26 854 | 2003,OK,7.47 855 | 2003,OR,7.06 856 | 2003,PA,9.59 857 | 2003,RI,11.61 858 | 2003,SC,8.01 859 | 2003,SD,7.47 860 | 2003,TN,6.55 861 | 2003,TX,9.16 862 | 2003,UT,6.9 863 | 2003,VA,7.76 864 | 2003,VT,12.82 865 | 2003,WA,6.31 866 | 2003,WI,8.67 867 | 2003,WV,6.24 868 | 2003,WY,7.04 869 | 2002,AK,12.05 870 | 2002,AL,7.12 871 | 2002,AR,7.25 872 | 2002,AZ,8.27 873 | 2002,CA,12.64 874 | 2002,CO,7.37 875 | 2002,CT,10.96 876 | 2002,DC,7.98 877 | 2002,DE,8.7 878 | 2002,FL,8.16 879 | 2002,GA,7.63 880 | 2002,HI,15.63 881 | 2002,IA,8.35 882 | 2002,ID,6.59 883 | 2002,IL,8.39 884 | 2002,IN,6.91 885 | 2002,KS,7.67 886 | 2002,KY,5.65 887 | 2002,LA,7.1 888 | 2002,MA,10.93 889 | 2002,MD,7.74 890 | 2002,ME,12.74 891 | 2002,MI,8.28 892 | 2002,MN,7.49 893 | 2002,MO,7.06 894 | 2002,MS,7.28 895 | 2002,MT,7.23 896 | 2002,NC,8.19 897 | 2002,ND,6.39 898 | 2002,NE,6.73 899 | 2002,NH,11.89 900 | 2002,NJ,10.38 901 | 2002,NM,8.5 902 | 2002,NV,9.43 903 | 2002,NY,13.55 904 | 2002,OH,8.24 905 | 2002,OK,6.73 906 | 2002,OR,7.12 907 | 2002,PA,9.74 908 | 2002,RI,10.2 909 | 2002,SC,7.72 910 | 2002,SD,7.4 911 | 2002,TN,6.41 912 | 2002,TX,8.05 913 | 2002,UT,6.79 914 | 2002,VA,7.79 915 | 2002,VT,12.78 916 | 2002,WA,6.29 917 | 2002,WI,8.18 918 | 2002,WV,6.23 919 | 2002,WY,6.97 920 | 2001,AK,12.12 921 | 2001,AL,7.01 922 | 2001,AR,7.72 923 | 2001,AZ,8.3 924 | 2001,CA,12.09 925 | 2001,CO,7.47 926 | 2001,CT,10.9 927 | 2001,DC,7.79 928 | 2001,DE,8.61 929 | 2001,FL,8.59 930 | 2001,GA,7.72 931 | 2001,HI,16.34 932 | 2001,IA,8.41 933 | 2001,ID,6.01 934 | 2001,IL,8.71 935 | 2001,IN,6.92 936 | 2001,KS,7.66 937 | 2001,KY,5.58 938 | 2001,LA,7.92 939 | 2001,MA,12.47 940 | 2001,MD,7.67 941 | 2001,ME,13.13 942 | 2001,MI,8.26 943 | 2001,MN,7.61 944 | 2001,MO,7 945 | 2001,MS,7.37 946 | 2001,MT,6.88 947 | 2001,NC,8.12 948 | 2001,ND,6.47 949 | 2001,NE,6.5 950 | 2001,NH,12.49 951 | 2001,NJ,10.21 952 | 2001,NM,8.74 953 | 2001,NV,9.08 954 | 2001,NY,14.04 955 | 2001,OH,8.37 956 | 2001,OK,7.27 957 | 2001,OR,6.29 958 | 2001,PA,9.68 959 | 2001,RI,12.13 960 | 2001,SC,7.69 961 | 2001,SD,7.42 962 | 2001,TN,6.32 963 | 2001,TX,8.86 964 | 2001,UT,6.72 965 | 2001,VA,7.79 966 | 2001,VT,12.67 967 | 2001,WA,5.7 968 | 2001,WI,7.9 969 | 2001,WV,6.26 970 | 2001,WY,6.77 971 | 2000,AK,11.45 972 | 2000,AL,7.05 973 | 2000,AR,7.45 974 | 2000,AZ,8.44 975 | 2000,CA,10.89 976 | 2000,CO,7.31 977 | 2000,CT,10.86 978 | 2000,DC,8.03 979 | 2000,DE,8.54 980 | 2000,FL,7.77 981 | 2000,GA,7.6 982 | 2000,HI,16.41 983 | 2000,IA,8.37 984 | 2000,ID,5.39 985 | 2000,IL,8.83 986 | 2000,IN,6.87 987 | 2000,KS,7.65 988 | 2000,KY,5.47 989 | 2000,LA,7.67 990 | 2000,MA,10.53 991 | 2000,MD,7.95 992 | 2000,ME,12.49 993 | 2000,MI,8.52 994 | 2000,MN,7.52 995 | 2000,MO,7.04 996 | 2000,MS,6.93 997 | 2000,MT,6.49 998 | 2000,NC,7.97 999 | 2000,ND,6.44 1000 | 2000,NE,6.53 1001 | 2000,NH,13.15 1002 | 2000,NJ,10.27 1003 | 2000,NM,8.36 1004 | 2000,NV,7.28 1005 | 2000,NY,13.97 1006 | 2000,OH,8.61 1007 | 2000,OK,7.03 1008 | 2000,OR,5.88 1009 | 2000,PA,9.53 1010 | 2000,RI,11.28 1011 | 2000,SC,7.58 1012 | 2000,SD,7.42 1013 | 2000,TN,6.33 1014 | 2000,TX,7.96 1015 | 2000,UT,6.29 1016 | 2000,VA,7.52 1017 | 2000,VT,12.3 1018 | 2000,WA,5.13 1019 | 2000,WI,7.53 1020 | 2000,WV,6.27 1021 | 2000,WY,6.5 1022 | 1999,AK,11.16 1023 | 1999,AL,7.03 1024 | 1999,AR,7.43 1025 | 1999,AZ,8.53 1026 | 1999,CA,10.64 1027 | 1999,CO,7.38 1028 | 1999,CT,11.46 1029 | 1999,DC,8 1030 | 1999,DE,9.17 1031 | 1999,FL,7.73 1032 | 1999,GA,7.56 1033 | 1999,HI,14.3 1034 | 1999,IA,8.35 1035 | 1999,ID,5.26 1036 | 1999,IL,8.83 1037 | 1999,IN,6.96 1038 | 1999,KS,7.64 1039 | 1999,KY,5.58 1040 | 1999,LA,7.12 1041 | 1999,MA,10.09 1042 | 1999,MD,8.39 1043 | 1999,ME,13.07 1044 | 1999,MI,8.73 1045 | 1999,MN,7.41 1046 | 1999,MO,7.12 1047 | 1999,MS,6.75 1048 | 1999,MT,6.78 1049 | 1999,NC,7.99 1050 | 1999,ND,6.5 1051 | 1999,NE,6.52 1052 | 1999,NH,13.64 1053 | 1999,NJ,11.4 1054 | 1999,NM,8.62 1055 | 1999,NV,7.13 1056 | 1999,NY,13.23 1057 | 1999,OH,8.68 1058 | 1999,OK,6.6 1059 | 1999,OR,5.75 1060 | 1999,PA,8.86 1061 | 1999,RI,10.12 1062 | 1999,SC,7.55 1063 | 1999,SD,7.42 1064 | 1999,TN,6.34 1065 | 1999,TX,7.55 1066 | 1999,UT,6.27 1067 | 1999,VA,7.48 1068 | 1999,VT,12.17 1069 | 1999,WA,5.1 1070 | 1999,WI,7.31 1071 | 1999,WV,6.27 1072 | 1999,WY,6.34 1073 | 1998,AK,11.5 1074 | 1998,AL,6.94 1075 | 1998,AR,7.51 1076 | 1998,AZ,8.68 1077 | 1998,CA,10.6 1078 | 1998,CO,7.45 1079 | 1998,CT,11.95 1080 | 1998,DC,8 1081 | 1998,DE,9.13 1082 | 1998,FL,7.89 1083 | 1998,GA,7.67 1084 | 1998,HI,13.82 1085 | 1998,IA,8.38 1086 | 1998,ID,5.28 1087 | 1998,IL,9.85 1088 | 1998,IN,7.01 1089 | 1998,KS,7.65 1090 | 1998,KY,5.61 1091 | 1998,LA,7.07 1092 | 1998,MA,10.6 1093 | 1998,MD,8.44 1094 | 1998,ME,13.02 1095 | 1998,MI,8.67 1096 | 1998,MN,7.33 1097 | 1998,MO,7.08 1098 | 1998,MS,7.03 1099 | 1998,MT,6.5 1100 | 1998,NC,8.01 1101 | 1998,ND,6.49 1102 | 1998,NE,6.46 1103 | 1998,NH,13.92 1104 | 1998,NJ,11.39 1105 | 1998,NM,8.85 1106 | 1998,NV,7 1107 | 1998,NY,13.66 1108 | 1998,OH,8.7 1109 | 1998,OK,6.57 1110 | 1998,OR,5.82 1111 | 1998,PA,9.93 1112 | 1998,RI,10.91 1113 | 1998,SC,7.5 1114 | 1998,SD,7.27 1115 | 1998,TN,6.32 1116 | 1998,TX,7.65 1117 | 1998,UT,6.84 1118 | 1998,VA,7.51 1119 | 1998,VT,11.61 1120 | 1998,WA,5.03 1121 | 1998,WI,7.17 1122 | 1998,WV,6.29 1123 | 1998,WY,6.28 1124 | 1997,AK,11.44 1125 | 1997,AL,6.74 1126 | 1997,AR,7.8 1127 | 1997,AZ,8.82 1128 | 1997,CA,11.5 1129 | 1997,CO,7.42 1130 | 1997,CT,12.13 1131 | 1997,DC,7.87 1132 | 1997,DE,9.22 1133 | 1997,FL,8.08 1134 | 1997,GA,7.74 1135 | 1997,HI,14.8 1136 | 1997,IA,8.21 1137 | 1997,ID,5.15 1138 | 1997,IL,10.43 1139 | 1997,IN,6.94 1140 | 1997,KS,7.71 1141 | 1997,KY,5.58 1142 | 1997,LA,7.39 1143 | 1997,MA,11.59 1144 | 1997,MD,8.33 1145 | 1997,ME,12.75 1146 | 1997,MI,8.57 1147 | 1997,MN,7.23 1148 | 1997,MO,7.09 1149 | 1997,MS,7.02 1150 | 1997,MT,6.4 1151 | 1997,NC,8.03 1152 | 1997,ND,6.27 1153 | 1997,NE,6.38 1154 | 1997,NH,13.67 1155 | 1997,NJ,12.08 1156 | 1997,NM,8.92 1157 | 1997,NV,6.77 1158 | 1997,NY,14.12 1159 | 1997,OH,8.63 1160 | 1997,OK,6.63 1161 | 1997,OR,5.56 1162 | 1997,PA,9.9 1163 | 1997,RI,12.12 1164 | 1997,SC,7.51 1165 | 1997,SD,7.08 1166 | 1997,TN,6.03 1167 | 1997,TX,7.82 1168 | 1997,UT,6.89 1169 | 1997,VA,7.75 1170 | 1997,VT,11.45 1171 | 1997,WA,4.95 1172 | 1997,WI,6.88 1173 | 1997,WV,6.26 1174 | 1997,WY,6.22 1175 | 1996,AK,11.36 1176 | 1996,AL,6.63 1177 | 1996,AR,7.77 1178 | 1996,AZ,8.95 1179 | 1996,CA,11.33 1180 | 1996,CO,7.49 1181 | 1996,CT,12.05 1182 | 1996,DC,7.77 1183 | 1996,DE,8.97 1184 | 1996,FL,7.99 1185 | 1996,GA,7.66 1186 | 1996,HI,14.26 1187 | 1996,IA,8.16 1188 | 1996,ID,5.28 1189 | 1996,IL,10.34 1190 | 1996,IN,6.77 1191 | 1996,KS,7.86 1192 | 1996,KY,5.55 1193 | 1996,LA,7.55 1194 | 1996,MA,11.25 1195 | 1996,MD,8.26 1196 | 1996,ME,12.58 1197 | 1996,MI,8.47 1198 | 1996,MN,7.13 1199 | 1996,MO,7.08 1200 | 1996,MS,7.04 1201 | 1996,MT,6.22 1202 | 1996,NC,8.05 1203 | 1996,ND,6.19 1204 | 1996,NE,6.29 1205 | 1996,NH,13.44 1206 | 1996,NJ,11.99 1207 | 1996,NM,8.93 1208 | 1996,NV,6.9 1209 | 1996,NY,14.04 1210 | 1996,OH,8.6 1211 | 1996,OK,6.71 1212 | 1996,OR,5.69 1213 | 1996,PA,9.73 1214 | 1996,RI,11.81 1215 | 1996,SC,7.5 1216 | 1996,SD,7 1217 | 1996,TN,5.88 1218 | 1996,TX,7.77 1219 | 1996,UT,6.96 1220 | 1996,VA,7.6 1221 | 1996,VT,10.99 1222 | 1996,WA,5.03 1223 | 1996,WI,6.88 1224 | 1996,WV,6.38 1225 | 1996,WY,6.13 1226 | 1995,AK,11.24 1227 | 1995,AL,6.71 1228 | 1995,AR,7.98 1229 | 1995,AZ,9.09 1230 | 1995,CA,11.61 1231 | 1995,CO,7.42 1232 | 1995,CT,11.95 1233 | 1995,DC,7.62 1234 | 1995,DE,9.09 1235 | 1995,FL,7.82 1236 | 1995,GA,7.85 1237 | 1995,HI,13.32 1238 | 1995,IA,8.24 1239 | 1995,ID,5.33 1240 | 1995,IL,10.37 1241 | 1995,IN,6.74 1242 | 1995,KS,7.92 1243 | 1995,KY,5.62 1244 | 1995,LA,7.23 1245 | 1995,MA,11.26 1246 | 1995,MD,8.43 1247 | 1995,ME,12.51 1248 | 1995,MI,8.34 1249 | 1995,MN,7.17 1250 | 1995,MO,7.25 1251 | 1995,MS,6.99 1252 | 1995,MT,6.09 1253 | 1995,NC,8.12 1254 | 1995,ND,6.23 1255 | 1995,NE,6.37 1256 | 1995,NH,13.5 1257 | 1995,NJ,11.98 1258 | 1995,NM,8.93 1259 | 1995,NV,7.11 1260 | 1995,NY,13.9 1261 | 1995,OH,8.6 1262 | 1995,OK,6.82 1263 | 1995,OR,5.49 1264 | 1995,PA,9.72 1265 | 1995,RI,11.47 1266 | 1995,SC,7.53 1267 | 1995,SD,7.08 1268 | 1995,TN,5.91 1269 | 1995,TX,7.71 1270 | 1995,UT,6.94 1271 | 1995,VA,7.84 1272 | 1995,VT,10.52 1273 | 1995,WA,4.97 1274 | 1995,WI,6.97 1275 | 1995,WV,6.5 1276 | 1995,WY,6.09 1277 | 1994,AK,11.32 1278 | 1994,AL,6.69 1279 | 1994,AR,8.07 1280 | 1994,AZ,9.3 1281 | 1994,CA,11.43 1282 | 1994,CO,7.36 1283 | 1994,CT,11.47 1284 | 1994,DC,7.47 1285 | 1994,DE,8.91 1286 | 1994,FL,7.78 1287 | 1994,GA,7.72 1288 | 1994,HI,12.45 1289 | 1994,IA,8.09 1290 | 1994,ID,5.09 1291 | 1994,IL,9.98 1292 | 1994,IN,6.78 1293 | 1994,KS,7.89 1294 | 1994,KY,5.77 1295 | 1994,LA,7.61 1296 | 1994,MA,11.09 1297 | 1994,MD,8.39 1298 | 1994,ME,12.32 1299 | 1994,MI,8.28 1300 | 1994,MN,7.16 1301 | 1994,MO,7.29 1302 | 1994,MS,7.06 1303 | 1994,MT,5.96 1304 | 1994,NC,8.17 1305 | 1994,ND,6.37 1306 | 1994,NE,6.31 1307 | 1994,NH,12.91 1308 | 1994,NJ,11.54 1309 | 1994,NM,9.14 1310 | 1994,NV,7.16 1311 | 1994,NY,13.55 1312 | 1994,OH,8.56 1313 | 1994,OK,7.03 1314 | 1994,OR,5.33 1315 | 1994,PA,9.55 1316 | 1994,RI,11.26 1317 | 1994,SC,7.49 1318 | 1994,SD,7.06 1319 | 1994,TN,5.88 1320 | 1994,TX,8.08 1321 | 1994,UT,6.91 1322 | 1994,VA,7.75 1323 | 1994,VT,9.96 1324 | 1994,WA,4.97 1325 | 1994,WI,7.08 1326 | 1994,WV,6.36 1327 | 1994,WY,6.04 1328 | 1993,AK,11.15 1329 | 1993,AL,6.82 1330 | 1993,AR,8.27 1331 | 1993,AZ,9.65 1332 | 1993,CA,11.3 1333 | 1993,CO,7.24 1334 | 1993,CT,11.39 1335 | 1993,DC,7.18 1336 | 1993,DE,9.01 1337 | 1993,FL,7.99 1338 | 1993,GA,7.79 1339 | 1993,HI,12.28 1340 | 1993,IA,8.02 1341 | 1993,ID,4.99 1342 | 1993,IL,10.28 1343 | 1993,IN,6.67 1344 | 1993,KS,7.86 1345 | 1993,KY,5.7 1346 | 1993,LA,7.76 1347 | 1993,MA,11 1348 | 1993,MD,8.21 1349 | 1993,ME,11.43 1350 | 1993,MI,8.16 1351 | 1993,MN,7.09 1352 | 1993,MO,7.26 1353 | 1993,MS,7.12 1354 | 1993,MT,5.77 1355 | 1993,NC,8.18 1356 | 1993,ND,6.31 1357 | 1993,NE,6.25 1358 | 1993,NH,12.31 1359 | 1993,NJ,11.41 1360 | 1993,NM,9.18 1361 | 1993,NV,6.51 1362 | 1993,NY,13.17 1363 | 1993,OH,8.36 1364 | 1993,OK,7.14 1365 | 1993,OR,5.02 1366 | 1993,PA,9.55 1367 | 1993,RI,11.38 1368 | 1993,SC,7.33 1369 | 1993,SD,7.04 1370 | 1993,TN,5.76 1371 | 1993,TX,8 1372 | 1993,UT,6.85 1373 | 1993,VA,7.57 1374 | 1993,VT,9.84 1375 | 1993,WA,4.6 1376 | 1993,WI,7.03 1377 | 1993,WV,6.3 1378 | 1993,WY,5.96 1379 | 1992,AK,10.82 1380 | 1992,AL,6.69 1381 | 1992,AR,8.28 1382 | 1992,AZ,9.58 1383 | 1992,CA,11.07 1384 | 1992,CO,7.2 1385 | 1992,CT,11.07 1386 | 1992,DC,6.61 1387 | 1992,DE,8.66 1388 | 1992,FL,7.75 1389 | 1992,GA,7.73 1390 | 1992,HI,10.9 1391 | 1992,IA,8.02 1392 | 1992,ID,4.93 1393 | 1992,IL,10.29 1394 | 1992,IN,6.86 1395 | 1992,KS,7.9 1396 | 1992,KY,5.7 1397 | 1992,LA,7.52 1398 | 1992,MA,10.62 1399 | 1992,MD,7.97 1400 | 1992,ME,11.37 1401 | 1992,MI,8.11 1402 | 1992,MN,7.01 1403 | 1992,MO,7.44 1404 | 1992,MS,7.01 1405 | 1992,MT,5.84 1406 | 1992,NC,8.11 1407 | 1992,ND,6.33 1408 | 1992,NE,6.27 1409 | 1992,NH,11.36 1410 | 1992,NJ,10.87 1411 | 1992,NM,9.06 1412 | 1992,NV,6.19 1413 | 1992,NY,12.43 1414 | 1992,OH,8.24 1415 | 1992,OK,7.17 1416 | 1992,OR,4.93 1417 | 1992,PA,9.67 1418 | 1992,RI,11.17 1419 | 1992,SC,7.19 1420 | 1992,SD,7.1 1421 | 1992,TN,5.7 1422 | 1992,TX,7.74 1423 | 1992,UT,6.97 1424 | 1992,VA,7.63 1425 | 1992,VT,9.56 1426 | 1992,WA,4.46 1427 | 1992,WI,6.91 1428 | 1992,WV,6.17 1429 | 1992,WY,6.08 1430 | 1991,AK,10.67 1431 | 1991,AL,6.69 1432 | 1991,AR,8.1 1433 | 1991,AZ,9.14 1434 | 1991,CA,10.79 1435 | 1991,CO,7.07 1436 | 1991,CT,10.51 1437 | 1991,DC,6.58 1438 | 1991,DE,8.62 1439 | 1991,FL,7.91 1440 | 1991,GA,7.5 1441 | 1991,HI,10.52 1442 | 1991,IA,7.76 1443 | 1991,ID,4.88 1444 | 1991,IL,9.87 1445 | 1991,IN,6.73 1446 | 1991,KS,7.83 1447 | 1991,KY,5.68 1448 | 1991,LA,7.4 1449 | 1991,MA,10.4 1450 | 1991,MD,7.9 1451 | 1991,ME,10.45 1452 | 1991,MI,8.06 1453 | 1991,MN,6.92 1454 | 1991,MO,7.39 1455 | 1991,MS,6.88 1456 | 1991,MT,5.76 1457 | 1991,NC,7.95 1458 | 1991,ND,6.21 1459 | 1991,NE,6.09 1460 | 1991,NH,10.38 1461 | 1991,NJ,10.81 1462 | 1991,NM,9.08 1463 | 1991,NV,5.89 1464 | 1991,NY,11.97 1465 | 1991,OH,8.16 1466 | 1991,OK,7.03 1467 | 1991,OR,4.81 1468 | 1991,PA,9.58 1469 | 1991,RI,10.99 1470 | 1991,SC,7.22 1471 | 1991,SD,6.91 1472 | 1991,TN,5.65 1473 | 1991,TX,7.57 1474 | 1991,UT,7.12 1475 | 1991,VA,7.34 1476 | 1991,VT,9.53 1477 | 1991,WA,4.36 1478 | 1991,WI,6.73 1479 | 1991,WV,5.91 1480 | 1991,WY,6 1481 | 1990,AK,10.11 1482 | 1990,AL,6.59 1483 | 1990,AR,8.07 1484 | 1990,AZ,9.04 1485 | 1990,CA,9.98 1486 | 1990,CO,7.02 1487 | 1990,CT,10.01 1488 | 1990,DC,6.1 1489 | 1990,DE,8.39 1490 | 1990,FL,7.77 1491 | 1990,GA,7.46 1492 | 1990,HI,10.26 1493 | 1990,IA,7.81 1494 | 1990,ID,4.87 1495 | 1990,IL,9.92 1496 | 1990,IN,6.87 1497 | 1990,KS,7.83 1498 | 1990,KY,5.69 1499 | 1990,LA,7.41 1500 | 1990,MA,9.66 1501 | 1990,MD,7.22 1502 | 1990,ME,9.3 1503 | 1990,MI,7.83 1504 | 1990,MN,6.8 1505 | 1990,MO,7.36 1506 | 1990,MS,6.89 1507 | 1990,MT,5.45 1508 | 1990,NC,7.84 1509 | 1990,ND,6.26 1510 | 1990,NE,6.23 1511 | 1990,NH,10.34 1512 | 1990,NJ,10.36 1513 | 1990,NM,8.94 1514 | 1990,NV,5.7 1515 | 1990,NY,11.44 1516 | 1990,OH,8.05 1517 | 1990,OK,6.58 1518 | 1990,OR,4.73 1519 | 1990,PA,9.22 1520 | 1990,RI,9.84 1521 | 1990,SC,7.15 1522 | 1990,SD,6.95 1523 | 1990,TN,5.69 1524 | 1990,TX,7.2 1525 | 1990,UT,7.13 1526 | 1990,VA,7.25 1527 | 1990,VT,9.27 1528 | 1990,WA,4.39 1529 | 1990,WI,6.63 1530 | 1990,WV,5.9 1531 | 1990,WY,5.97 1532 | -------------------------------------------------------------------------------- /html_components_overview.py: -------------------------------------------------------------------------------- 1 | from dash import Dash, html 2 | 3 | app = Dash() 4 | 5 | app.layout = html.Div(children=[ 6 | html.H1(children='World Happiness Dashboard'), 7 | html.P(['This dashboard shows the happiness score.', 8 | html.Br(), 9 | html.A('World Happiness Report Data Source', 10 | href='https://worldhappiness.report/', 11 | target='_blank')])]) 12 | 13 | if __name__ == '__main__': 14 | app.run_server(debug=True) 15 | -------------------------------------------------------------------------------- /intro_to_jupyterdash.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "id": "51f564d8-68f4-4e63-b8ef-7d9a87bf7151", 6 | "metadata": { 7 | "tags": [] 8 | }, 9 | "source": [ 10 | "# Install jupyter-dash" 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": 1, 16 | "id": "ffdcfd5a-f79d-4918-bda1-eb28b6a36087", 17 | "metadata": { 18 | "tags": [] 19 | }, 20 | "outputs": [], 21 | "source": [ 22 | "# %pip install jupyter-dash" 23 | ] 24 | }, 25 | { 26 | "cell_type": "markdown", 27 | "id": "77f2e209-4852-4139-a7c5-2984bcbb7242", 28 | "metadata": {}, 29 | "source": [ 30 | "# Import libraries" 31 | ] 32 | }, 33 | { 34 | "cell_type": "code", 35 | "execution_count": 2, 36 | "id": "6666f0e1-c9b7-4c52-8e05-f0a50dcfa5c8", 37 | "metadata": {}, 38 | "outputs": [], 39 | "source": [ 40 | "from jupyter_dash import JupyterDash # from dash import Dash\n", 41 | "from dash import html, dcc, Input, Output\n", 42 | "import pandas as pd\n", 43 | "import plotly.express as px" 44 | ] 45 | }, 46 | { 47 | "cell_type": "markdown", 48 | "id": "36a77ba7-2de4-4ae9-b9cc-62a49e16e5a7", 49 | "metadata": {}, 50 | "source": [ 51 | "# Load data" 52 | ] 53 | }, 54 | { 55 | "cell_type": "code", 56 | "execution_count": 3, 57 | "id": "29489acd-1b98-45dd-b6ac-56b72ffa8f57", 58 | "metadata": {}, 59 | "outputs": [], 60 | "source": [ 61 | "happiness = pd.read_csv('world_happiness.csv')" 62 | ] 63 | }, 64 | { 65 | "cell_type": "markdown", 66 | "id": "fb3bc36e-51a6-48bb-bc88-c3ae25798cbc", 67 | "metadata": {}, 68 | "source": [ 69 | "# Build the app" 70 | ] 71 | }, 72 | { 73 | "cell_type": "code", 74 | "execution_count": 4, 75 | "id": "8bbda44b-8e83-4a3a-af66-bac670b882c2", 76 | "metadata": {}, 77 | "outputs": [], 78 | "source": [ 79 | "app = JupyterDash() # app = Dash()\n", 80 | "\n", 81 | "app.layout = html.Div([\n", 82 | " html.H1('World Happiness Dashboard'),\n", 83 | " html.P(['This dashboard shows the happiness score.',\n", 84 | " html.Br(),\n", 85 | " html.A('World Happiness Report Data Source',\n", 86 | " href='https://worldhappiness.report/',\n", 87 | " target='_blank')]),\n", 88 | " dcc.Dropdown(id='country-dropdown',\n", 89 | " options=happiness['country'].unique(),\n", 90 | " value='United States'),\n", 91 | " dcc.Graph(id='happiness-graph')])\n", 92 | "\n", 93 | "\n", 94 | "@app.callback(\n", 95 | " Output('happiness-graph', 'figure'),\n", 96 | " Input('country-dropdown', 'value'))\n", 97 | "def update_graph(selected_country):\n", 98 | " filtered_happiness = happiness[happiness['country'] == selected_country]\n", 99 | " line_fig = px.line(filtered_happiness,\n", 100 | " x='year', y='happiness_score',\n", 101 | " title=f'Happiness Score in {selected_country}')\n", 102 | " return line_fig" 103 | ] 104 | }, 105 | { 106 | "cell_type": "markdown", 107 | "id": "86280497-4359-42ab-9502-3e78ebee1bb8", 108 | "metadata": {}, 109 | "source": [ 110 | "# Run server - 3 available modes: `external`, `inline`, `jupyterlab`" 111 | ] 112 | }, 113 | { 114 | "cell_type": "code", 115 | "execution_count": 5, 116 | "id": "faca2af4-9f03-4a84-909f-c6885de7d159", 117 | "metadata": {}, 118 | "outputs": [ 119 | { 120 | "name": "stdout", 121 | "output_type": "stream", 122 | "text": [ 123 | "Dash app running on http://127.0.0.1:8050/\n" 124 | ] 125 | } 126 | ], 127 | "source": [ 128 | "app.run_server(mode='external')" 129 | ] 130 | }, 131 | { 132 | "cell_type": "code", 133 | "execution_count": 6, 134 | "id": "db983226-bb16-4948-8d3d-f83d4c8a9183", 135 | "metadata": {}, 136 | "outputs": [ 137 | { 138 | "data": { 139 | "text/html": [ 140 | "\n", 141 | " \n", 149 | " " 150 | ], 151 | "text/plain": [ 152 | "" 153 | ] 154 | }, 155 | "metadata": {}, 156 | "output_type": "display_data" 157 | } 158 | ], 159 | "source": [ 160 | "app.run_server(mode='inline')" 161 | ] 162 | }, 163 | { 164 | "cell_type": "code", 165 | "execution_count": 7, 166 | "id": "2ca0d5fd-3cdf-433e-8d85-02b3290ea210", 167 | "metadata": {}, 168 | "outputs": [], 169 | "source": [ 170 | "# app.run_server(mode='jupyterlab')\n", 171 | "# https://github.com/plotly/jupyter-dash#jupyterlab-support" 172 | ] 173 | } 174 | ], 175 | "metadata": { 176 | "kernelspec": { 177 | "display_name": "Python 3 (ipykernel)", 178 | "language": "python", 179 | "name": "python3" 180 | }, 181 | "language_info": { 182 | "codemirror_mode": { 183 | "name": "ipython", 184 | "version": 3 185 | }, 186 | "file_extension": ".py", 187 | "mimetype": "text/x-python", 188 | "name": "python", 189 | "nbconvert_exporter": "python", 190 | "pygments_lexer": "ipython3", 191 | "version": "3.9.7" 192 | } 193 | }, 194 | "nbformat": 4, 195 | "nbformat_minor": 5 196 | } 197 | -------------------------------------------------------------------------------- /life_expectancy_dashboard_solution.py: -------------------------------------------------------------------------------- 1 | from dash import Dash, html, dcc, Input, Output, State 2 | import dash_bootstrap_components as dbc 3 | import plotly.express as px 4 | import pandas as pd 5 | from dash.exceptions import PreventUpdate 6 | 7 | life_expectancy = pd.read_csv('life_expectancy.csv') 8 | 9 | navbar = dbc.NavbarSimple( 10 | brand='Life Expectancy Dashboard', 11 | brand_style={'fontSize': 40, 'color': 'white'}, 12 | children=html.A('Data Source', 13 | href='https://ourworldindata.org/life-expectancy', 14 | target='_blank', 15 | style={'color': 'black'}), 16 | color='primary', 17 | fluid=True, 18 | sticky='top' 19 | ) 20 | 21 | year_min = life_expectancy['year'].min() 22 | year_max = life_expectancy['year'].max() 23 | 24 | year_slider = dcc.RangeSlider( 25 | min=year_min, 26 | max=year_max, 27 | value=[year_min, year_max], 28 | marks={i: str(i) for i in range(year_min, year_max+1, 10)}, 29 | step=1, 30 | tooltip={'placement': 'top', 'always_visible': True} 31 | ) 32 | 33 | input_card = dbc.Card([ 34 | html.H5('Life expectancy by countries'), 35 | year_slider 36 | ], 37 | body=True, 38 | style={'textAlign': 'center', 'color': 'white'}, 39 | color='darkblue' 40 | ) 41 | 42 | 43 | app = Dash(external_stylesheets=[dbc.themes.BOOTSTRAP]) 44 | 45 | 46 | app.layout = html.Div([ 47 | navbar, 48 | input_card, 49 | html.Br(), 50 | dcc.Dropdown(id='country-dropdown', 51 | options=life_expectancy['country'].unique(), 52 | multi=True), 53 | html.Br(), 54 | html.Button(id='submit-button', 55 | children='Submit'), 56 | html.Br(), 57 | dcc.Graph(id='life-expectancy-graph'), 58 | ]) 59 | 60 | 61 | @app.callback( 62 | Output('life-expectancy-graph', 'figure'), 63 | Input('submit-button', 'n_clicks'), 64 | State('country-dropdown', 'value'), 65 | State(year_slider, 'value')) 66 | def update_output(button_click, selected_country, selected_years): 67 | if selected_country is None: 68 | raise PreventUpdate 69 | msk = (life_expectancy['country'].isin(selected_country)) & \ 70 | (life_expectancy['year'] >= selected_years[0]) & \ 71 | (life_expectancy['year'] <= selected_years[1]) 72 | life_expectancy_filtered = life_expectancy[msk] 73 | line_fig = px.line(life_expectancy_filtered, 74 | x='year', y='life expectancy', 75 | title='Life expectancy', 76 | color='country') 77 | return line_fig 78 | 79 | 80 | if __name__ == '__main__': 81 | app.run_server(debug=True) 82 | -------------------------------------------------------------------------------- /setting_up_the_layout_candlestick_datatable.py: -------------------------------------------------------------------------------- 1 | from dash import Dash, html, dcc, dash_table 2 | import plotly.graph_objects as go 3 | import yfinance as yf 4 | 5 | app = Dash() 6 | 7 | 8 | price = yf.Ticker('AAPL').history(period='1d', interval='15m').reset_index() 9 | 10 | fig = go.Figure(data=go.Candlestick( 11 | x=price['Datetime'], 12 | open=price['Open'], 13 | high=price['High'], 14 | low=price['Low'], 15 | close=price['Close'])) 16 | 17 | app.layout = html.Div([ 18 | html.H1('My financial dashboard'), 19 | dcc.Input(id='ticker-input', 20 | placeholder='Search for symbols from Yahoo Finance', 21 | style={'width': '50%'}), 22 | html.Button(id='submit-button', children='Submit'), 23 | dcc.Graph(id='stock-graph', 24 | figure=fig), 25 | dash_table.DataTable(id='stock-data', 26 | data=price.tail(10).to_dict('records')) 27 | ]) 28 | 29 | 30 | if __name__ == '__main__': 31 | app.run_server(debug=True) 32 | -------------------------------------------------------------------------------- /setting_up_the_layout_datatable.py: -------------------------------------------------------------------------------- 1 | from dash import Dash, html, dcc, dash_table 2 | import dash_bootstrap_components as dbc 3 | import plotly.express as px 4 | import pandas as pd 5 | 6 | electricity = pd.read_csv('electricity.csv') 7 | 8 | year_min = electricity['Year'].min() 9 | year_max = electricity['Year'].max() 10 | 11 | avg_price_electricity = electricity.groupby('US_State')['Residential Price'].mean().reset_index() 12 | map_fig = px.choropleth(avg_price_electricity, 13 | locations='US_State', locationmode='USA-states', 14 | color='Residential Price', scope='usa', 15 | color_continuous_scale='reds') 16 | 17 | app = Dash(external_stylesheets=[dbc.themes.SOLAR]) 18 | 19 | app.layout = html.Div([ 20 | html.H1('Electricity Prices by US State'), 21 | dcc.RangeSlider(id='year-slider', 22 | min=year_min, 23 | max=year_max, 24 | value=[year_min, year_max], 25 | marks={i: str(i) for i in range( 26 | year_min, year_max+1)} 27 | ), 28 | dcc.Graph(id='map-graph', figure=map_fig), 29 | dash_table.DataTable( 30 | id='price-info', 31 | data=electricity.to_dict('records') 32 | ) 33 | ]) 34 | 35 | if __name__ == '__main__': 36 | app.run_server(debug=True) 37 | -------------------------------------------------------------------------------- /setting_up_the_layout_input_button.py: -------------------------------------------------------------------------------- 1 | from dash import Dash, html, dcc 2 | 3 | app = Dash() 4 | 5 | 6 | app.layout = html.Div([ 7 | html.H1('My financial dashboard'), 8 | dcc.Input(id='ticker-input', 9 | placeholder='Search for symbols from Yahoo Finance', 10 | style={'width': '50%'}), 11 | html.Button(id='submit-button', children='Submit') 12 | ]) 13 | 14 | 15 | if __name__ == '__main__': 16 | app.run_server(debug=True) 17 | -------------------------------------------------------------------------------- /setting_up_the_layout_interval.py: -------------------------------------------------------------------------------- 1 | from dash import Dash, html, dcc, dash_table 2 | import plotly.graph_objects as go 3 | import yfinance as yf 4 | 5 | app = Dash() 6 | 7 | 8 | price = yf.Ticker('AAPL').history(period='1d', interval='15m').reset_index() 9 | 10 | fig = go.Figure(data=go.Candlestick( 11 | x=price['Datetime'], 12 | open=price['Open'], 13 | high=price['High'], 14 | low=price['Low'], 15 | close=price['Close'])) 16 | 17 | app.layout = html.Div([ 18 | html.H1('My financial dashboard'), 19 | dcc.Input(id='ticker-input', 20 | placeholder='Search for symbols from Yahoo Finance', 21 | style={'width': '50%'}), 22 | html.Button(id='submit-button', children='Submit'), 23 | html.Br(), 24 | html.Br(), 25 | dcc.Tabs([ 26 | dcc.Tab(label='Candlestick Chart', 27 | children=dcc.Graph(id='stock-graph', 28 | figure=fig)), 29 | dcc.Tab(label='Recent Data', 30 | children=dash_table.DataTable(id='stock-data', 31 | data=price.tail(10).to_dict('records'))) 32 | ]), 33 | dcc.Interval(id='chart-interval', interval=1000*60*15, n_intervals=0), 34 | dcc.Interval(id='table-interval', interval=1000*60, n_intervals=0) 35 | ]) 36 | 37 | 38 | if __name__ == '__main__': 39 | app.run_server(debug=True) 40 | -------------------------------------------------------------------------------- /setting_up_the_layout_map.py: -------------------------------------------------------------------------------- 1 | from dash import Dash, html, dcc 2 | import plotly.express as px 3 | import pandas as pd 4 | 5 | electricity = pd.read_csv('electricity.csv') 6 | 7 | year_min = electricity['Year'].min() 8 | year_max = electricity['Year'].max() 9 | 10 | avg_price_electricity = electricity.groupby('US_State')['Residential Price'].mean().reset_index() 11 | map_fig = px.choropleth(avg_price_electricity, 12 | locations='US_State', locationmode='USA-states', 13 | color='Residential Price', scope='usa', 14 | color_continuous_scale='reds') 15 | 16 | 17 | app = Dash() 18 | 19 | app.layout = html.Div([ 20 | html.H1('Electricity Prices by US State'), 21 | dcc.RangeSlider(id='year-slider', 22 | min=year_min, 23 | max=year_max, 24 | value=[year_min, year_max], 25 | marks={i: str(i) for i in range( 26 | year_min, year_max+1)} 27 | ), 28 | dcc.Graph(id='map-graph', figure=map_fig) 29 | ]) 30 | 31 | if __name__ == '__main__': 32 | app.run_server(debug=True) 33 | -------------------------------------------------------------------------------- /setting_up_the_layout_rangeslider.py: -------------------------------------------------------------------------------- 1 | from dash import Dash, html, dcc 2 | import pandas as pd 3 | 4 | electricity = pd.read_csv('electricity.csv') 5 | 6 | year_min = electricity['Year'].min() 7 | year_max = electricity['Year'].max() 8 | 9 | app = Dash() 10 | 11 | app.layout = html.Div([ 12 | html.H1('Electricity Prices by US State'), 13 | dcc.RangeSlider(id='year-slider', 14 | min=year_min, 15 | max=year_max, 16 | value=[year_min, year_max], 17 | marks={i: str(i) for i in range( 18 | year_min, year_max+1)} 19 | ) 20 | ]) 21 | 22 | if __name__ == '__main__': 23 | app.run_server(debug=True) 24 | -------------------------------------------------------------------------------- /setting_up_the_layout_tabs.py: -------------------------------------------------------------------------------- 1 | from dash import Dash, html, dcc, dash_table 2 | import plotly.graph_objects as go 3 | import yfinance as yf 4 | 5 | app = Dash() 6 | 7 | 8 | price = yf.Ticker('AAPL').history(period='1d', interval='15m').reset_index() 9 | 10 | fig = go.Figure(data=go.Candlestick( 11 | x=price['Datetime'], 12 | open=price['Open'], 13 | high=price['High'], 14 | low=price['Low'], 15 | close=price['Close'])) 16 | 17 | app.layout = html.Div([ 18 | html.H1('My financial dashboard'), 19 | dcc.Input(id='ticker-input', 20 | placeholder='Search for symbols from Yahoo Finance', 21 | style={'width': '50%'}), 22 | html.Button(id='submit-button', children='Submit'), 23 | html.Br(), 24 | html.Br(), 25 | dcc.Tabs([ 26 | dcc.Tab(label='Candlestick Chart', 27 | children=dcc.Graph(id='stock-graph', 28 | figure=fig)), 29 | dcc.Tab(label='Recent Data', 30 | children=dash_table.DataTable(id='stock-data', 31 | data=price.tail(10).to_dict('records'))) 32 | ]) 33 | ]) 34 | 35 | 36 | if __name__ == '__main__': 37 | app.run_server(debug=True) 38 | -------------------------------------------------------------------------------- /world_happiness.csv: -------------------------------------------------------------------------------- 1 | country,region,happiness_rank,happiness_score,year 2 | Australia,Australia and New Zealand,10,7.284,2015 3 | Australia,Australia and New Zealand,9,7.313,2016 4 | Australia,Australia and New Zealand,10,7.28399991989136,2017 5 | Australia,Australia and New Zealand,10,7.272,2018 6 | Australia,Australia and New Zealand,11,7.228,2019 7 | Australia,Australia and New Zealand,11,7.222799778,2020 8 | New Zealand,Australia and New Zealand,9,7.286,2015 9 | New Zealand,Australia and New Zealand,8,7.334,2016 10 | New Zealand,Australia and New Zealand,8,7.31400012969971,2017 11 | New Zealand,Australia and New Zealand,8,7.324,2018 12 | New Zealand,Australia and New Zealand,8,7.307,2019 13 | New Zealand,Australia and New Zealand,7,7.299600123999999,2020 14 | Albania,Central and Eastern Europe,95,4.959,2015 15 | Albania,Central and Eastern Europe,109,4.655,2016 16 | Albania,Central and Eastern Europe,109,4.64400005340576,2017 17 | Albania,Central and Eastern Europe,112,4.586,2018 18 | Albania,Central and Eastern Europe,107,4.718999999999999,2019 19 | Albania,Central and Eastern Europe,104,4.882699966000001,2020 20 | Armenia,Central and Eastern Europe,127,4.35,2015 21 | Armenia,Central and Eastern Europe,121,4.36,2016 22 | Armenia,Central and Eastern Europe,121,4.37599992752075,2017 23 | Armenia,Central and Eastern Europe,129,4.321000000000001,2018 24 | Armenia,Central and Eastern Europe,116,4.559,2019 25 | Armenia,Central and Eastern Europe,115,4.676799774,2020 26 | Azerbaijan,Central and Eastern Europe,80,5.212000000000001,2015 27 | Azerbaijan,Central and Eastern Europe,81,5.291,2016 28 | Azerbaijan,Central and Eastern Europe,85,5.234000205993651,2017 29 | Azerbaijan,Central and Eastern Europe,87,5.2010000000000005,2018 30 | Azerbaijan,Central and Eastern Europe,90,5.207999999999999,2019 31 | Azerbaijan,Central and Eastern Europe,88,5.164800167,2020 32 | Belarus,Central and Eastern Europe,59,5.813,2015 33 | Belarus,Central and Eastern Europe,61,5.8020000000000005,2016 34 | Belarus,Central and Eastern Europe,67,5.5689997673034695,2017 35 | Belarus,Central and Eastern Europe,73,5.483,2018 36 | Belarus,Central and Eastern Europe,81,5.323,2019 37 | Belarus,Central and Eastern Europe,74,5.539899826,2020 38 | Bosnia and Herzegovina,Central and Eastern Europe,96,4.949,2015 39 | Bosnia and Herzegovina,Central and Eastern Europe,87,5.162999999999999,2016 40 | Bosnia and Herzegovina,Central and Eastern Europe,90,5.18200016021729,2017 41 | Bosnia and Herzegovina,Central and Eastern Europe,93,5.129,2018 42 | Bosnia and Herzegovina,Central and Eastern Europe,78,5.386,2019 43 | Bosnia and Herzegovina,Central and Eastern Europe,68,5.674099922000001,2020 44 | Bulgaria,Central and Eastern Europe,134,4.218,2015 45 | Bulgaria,Central and Eastern Europe,129,4.217,2016 46 | Bulgaria,Central and Eastern Europe,105,4.71400022506714,2017 47 | Bulgaria,Central and Eastern Europe,100,4.933,2018 48 | Bulgaria,Central and Eastern Europe,97,5.011,2019 49 | Bulgaria,Central and Eastern Europe,95,5.101500034,2020 50 | Croatia,Central and Eastern Europe,62,5.759,2015 51 | Croatia,Central and Eastern Europe,74,5.488,2016 52 | Croatia,Central and Eastern Europe,77,5.2930002212524405,2017 53 | Croatia,Central and Eastern Europe,82,5.321000000000001,2018 54 | Croatia,Central and Eastern Europe,75,5.432,2019 55 | Croatia,Central and Eastern Europe,78,5.504700184,2020 56 | Czech Republic,Central and Eastern Europe,31,6.505,2015 57 | Czech Republic,Central and Eastern Europe,27,6.596,2016 58 | Czech Republic,Central and Eastern Europe,23,6.60900020599365,2017 59 | Czech Republic,Central and Eastern Europe,21,6.711,2018 60 | Czech Republic,Central and Eastern Europe,20,6.852,2019 61 | Czech Republic,Central and Eastern Europe,18,6.9109001160000005,2020 62 | Estonia,Central and Eastern Europe,73,5.428999999999999,2015 63 | Estonia,Central and Eastern Europe,72,5.517,2016 64 | Estonia,Central and Eastern Europe,66,5.61100006103516,2017 65 | Estonia,Central and Eastern Europe,63,5.739,2018 66 | Estonia,Central and Eastern Europe,55,5.893,2019 67 | Estonia,Central and Eastern Europe,50,6.0218000410000005,2020 68 | Georgia,Central and Eastern Europe,130,4.297,2015 69 | Georgia,Central and Eastern Europe,126,4.252,2016 70 | Georgia,Central and Eastern Europe,125,4.28599977493286,2017 71 | Georgia,Central and Eastern Europe,128,4.34,2018 72 | Georgia,Central and Eastern Europe,119,4.519,2019 73 | Georgia,Central and Eastern Europe,116,4.672599792,2020 74 | Hungary,Central and Eastern Europe,104,4.8,2015 75 | Hungary,Central and Eastern Europe,91,5.145,2016 76 | Hungary,Central and Eastern Europe,75,5.32399988174438,2017 77 | Hungary,Central and Eastern Europe,69,5.62,2018 78 | Hungary,Central and Eastern Europe,62,5.757999999999999,2019 79 | Hungary,Central and Eastern Europe,52,6.000400066,2020 80 | Kazakhstan,Central and Eastern Europe,54,5.855,2015 81 | Kazakhstan,Central and Eastern Europe,54,5.919,2016 82 | Kazakhstan,Central and Eastern Europe,60,5.8189997673034695,2017 83 | Kazakhstan,Central and Eastern Europe,60,5.79,2018 84 | Kazakhstan,Central and Eastern Europe,60,5.809,2019 85 | Kazakhstan,Central and Eastern Europe,49,6.0578999520000005,2020 86 | Kosovo,Central and Eastern Europe,69,5.589,2015 87 | Kosovo,Central and Eastern Europe,77,5.401,2016 88 | Kosovo,Central and Eastern Europe,78,5.27899980545044,2017 89 | Kosovo,Central and Eastern Europe,66,5.662000000000001,2018 90 | Kosovo,Central and Eastern Europe,46,6.1,2019 91 | Kosovo,Central and Eastern Europe,34,6.325200081,2020 92 | Kyrgyzstan,Central and Eastern Europe,77,5.2860000000000005,2015 93 | Kyrgyzstan,Central and Eastern Europe,85,5.185,2016 94 | Kyrgyzstan,Central and Eastern Europe,98,5.0040001869201705,2017 95 | Kyrgyzstan,Central and Eastern Europe,92,5.131,2018 96 | Kyrgyzstan,Central and Eastern Europe,86,5.261,2019 97 | Kyrgyzstan,Central and Eastern Europe,73,5.541500092000001,2020 98 | Latvia,Central and Eastern Europe,89,5.098,2015 99 | Latvia,Central and Eastern Europe,68,5.56,2016 100 | Latvia,Central and Eastern Europe,54,5.849999904632571,2017 101 | Latvia,Central and Eastern Europe,53,5.933,2018 102 | Latvia,Central and Eastern Europe,53,5.94,2019 103 | Latvia,Central and Eastern Europe,56,5.949999809,2020 104 | Lithuania,Central and Eastern Europe,56,5.832999999999999,2015 105 | Lithuania,Central and Eastern Europe,60,5.813,2016 106 | Lithuania,Central and Eastern Europe,52,5.90199995040894,2017 107 | Lithuania,Central and Eastern Europe,50,5.952000000000001,2018 108 | Lithuania,Central and Eastern Europe,42,6.149,2019 109 | Lithuania,Central and Eastern Europe,40,6.215499877999999,2020 110 | Moldova,Central and Eastern Europe,52,5.888999999999999,2015 111 | Moldova,Central and Eastern Europe,55,5.897,2016 112 | Moldova,Central and Eastern Europe,56,5.837999820709231,2017 113 | Moldova,Central and Eastern Europe,67,5.64,2018 114 | Moldova,Central and Eastern Europe,71,5.529,2019 115 | Moldova,Central and Eastern Europe,69,5.607500076,2020 116 | Montenegro,Central and Eastern Europe,82,5.192,2015 117 | Montenegro,Central and Eastern Europe,88,5.1610000000000005,2016 118 | Montenegro,Central and Eastern Europe,83,5.23699998855591,2017 119 | Montenegro,Central and Eastern Europe,81,5.347,2018 120 | Montenegro,Central and Eastern Europe,73,5.523,2019 121 | Montenegro,Central and Eastern Europe,71,5.54610014,2020 122 | Poland,Central and Eastern Europe,60,5.791,2015 123 | Poland,Central and Eastern Europe,57,5.835,2016 124 | Poland,Central and Eastern Europe,46,5.97300004959106,2017 125 | Poland,Central and Eastern Europe,42,6.122999999999999,2018 126 | Poland,Central and Eastern Europe,40,6.182,2019 127 | Poland,Central and Eastern Europe,42,6.1862998010000005,2020 128 | Romania,Central and Eastern Europe,86,5.124,2015 129 | Romania,Central and Eastern Europe,71,5.528,2016 130 | Romania,Central and Eastern Europe,57,5.824999809265139,2017 131 | Romania,Central and Eastern Europe,52,5.945,2018 132 | Romania,Central and Eastern Europe,48,6.07,2019 133 | Romania,Central and Eastern Europe,46,6.123700142000001,2020 134 | Russia,Central and Eastern Europe,64,5.716,2015 135 | Russia,Central and Eastern Europe,56,5.856,2016 136 | Russia,Central and Eastern Europe,49,5.962999820709231,2017 137 | Russia,Central and Eastern Europe,59,5.81,2018 138 | Russia,Central and Eastern Europe,68,5.648,2019 139 | Russia,Central and Eastern Europe,72,5.546000004,2020 140 | Serbia,Central and Eastern Europe,87,5.122999999999999,2015 141 | Serbia,Central and Eastern Europe,86,5.1770000000000005,2016 142 | Serbia,Central and Eastern Europe,73,5.39499998092651,2017 143 | Serbia,Central and Eastern Europe,78,5.398,2018 144 | Serbia,Central and Eastern Europe,70,5.603,2019 145 | Serbia,Central and Eastern Europe,63,5.77820015,2020 146 | Slovakia,Central and Eastern Europe,45,5.995,2015 147 | Slovakia,Central and Eastern Europe,45,6.077999999999999,2016 148 | Slovakia,Central and Eastern Europe,40,6.09800004959106,2017 149 | Slovakia,Central and Eastern Europe,39,6.172999999999999,2018 150 | Slovakia,Central and Eastern Europe,38,6.198,2019 151 | Slovakia,Central and Eastern Europe,36,6.280600071,2020 152 | Slovenia,Central and Eastern Europe,55,5.848,2015 153 | Slovenia,Central and Eastern Europe,63,5.768,2016 154 | Slovenia,Central and Eastern Europe,62,5.75799989700317,2017 155 | Slovenia,Central and Eastern Europe,51,5.948,2018 156 | Slovenia,Central and Eastern Europe,44,6.117999999999999,2019 157 | Slovenia,Central and Eastern Europe,32,6.363399982000001,2020 158 | Tajikistan,Central and Eastern Europe,106,4.7860000000000005,2015 159 | Tajikistan,Central and Eastern Europe,100,4.996,2016 160 | Tajikistan,Central and Eastern Europe,96,5.04099988937378,2017 161 | Tajikistan,Central and Eastern Europe,88,5.199,2018 162 | Tajikistan,Central and Eastern Europe,74,5.4670000000000005,2019 163 | Tajikistan,Central and Eastern Europe,70,5.555699825,2020 164 | Turkmenistan,Central and Eastern Europe,70,5.547999999999999,2015 165 | Turkmenistan,Central and Eastern Europe,65,5.658,2016 166 | Turkmenistan,Central and Eastern Europe,59,5.82200002670288,2017 167 | Turkmenistan,Central and Eastern Europe,68,5.636,2018 168 | Turkmenistan,Central and Eastern Europe,87,5.247000000000001,2019 169 | Turkmenistan,Central and Eastern Europe,94,5.119100093999999,2020 170 | Ukraine,Central and Eastern Europe,111,4.681,2015 171 | Ukraine,Central and Eastern Europe,123,4.324,2016 172 | Ukraine,Central and Eastern Europe,132,4.09600019454956,2017 173 | Ukraine,Central and Eastern Europe,138,4.103,2018 174 | Ukraine,Central and Eastern Europe,133,4.332,2019 175 | Ukraine,Central and Eastern Europe,122,4.56069994,2020 176 | Uzbekistan,Central and Eastern Europe,44,6.002999999999999,2015 177 | Uzbekistan,Central and Eastern Europe,49,5.987,2016 178 | Uzbekistan,Central and Eastern Europe,47,5.97100019454956,2017 179 | Uzbekistan,Central and Eastern Europe,44,6.096,2018 180 | Uzbekistan,Central and Eastern Europe,41,6.174,2019 181 | Uzbekistan,Central and Eastern Europe,37,6.257599831,2020 182 | China,Eastern Asia,84,5.14,2015 183 | China,Eastern Asia,83,5.245,2016 184 | China,Eastern Asia,79,5.2729997634887695,2017 185 | China,Eastern Asia,86,5.246,2018 186 | China,Eastern Asia,93,5.191,2019 187 | China,Eastern Asia,93,5.123899937,2020 188 | Japan,Eastern Asia,46,5.987,2015 189 | Japan,Eastern Asia,53,5.921,2016 190 | Japan,Eastern Asia,51,5.92000007629395,2017 191 | Japan,Eastern Asia,54,5.915,2018 192 | Japan,Eastern Asia,58,5.886,2019 193 | Japan,Eastern Asia,61,5.870800018,2020 194 | Mongolia,Eastern Asia,100,4.874,2015 195 | Mongolia,Eastern Asia,101,4.907,2016 196 | Mongolia,Eastern Asia,100,4.95499992370605,2017 197 | Mongolia,Eastern Asia,94,5.125,2018 198 | Mongolia,Eastern Asia,83,5.285,2019 199 | Mongolia,Eastern Asia,80,5.456200123,2020 200 | South Korea,Eastern Asia,47,5.984,2015 201 | South Korea,Eastern Asia,57,5.835,2016 202 | South Korea,Eastern Asia,55,5.837999820709231,2017 203 | South Korea,Eastern Asia,57,5.875,2018 204 | South Korea,Eastern Asia,54,5.895,2019 205 | South Korea,Eastern Asia,60,5.872399807000001,2020 206 | Taiwan,Eastern Asia,38,6.297999999999999,2015 207 | Taiwan,Eastern Asia,34,6.379,2016 208 | Taiwan,Eastern Asia,33,6.42199993133545,2017 209 | Taiwan,Eastern Asia,26,6.441,2018 210 | Taiwan,Eastern Asia,25,6.446000000000001,2019 211 | Taiwan,Eastern Asia,24,6.45539999,2020 212 | Argentina,Latin America and Caribbean,30,6.574,2015 213 | Argentina,Latin America and Caribbean,26,6.65,2016 214 | Argentina,Latin America and Caribbean,24,6.59899997711182,2017 215 | Argentina,Latin America and Caribbean,29,6.388,2018 216 | Argentina,Latin America and Caribbean,47,6.086,2019 217 | Argentina,Latin America and Caribbean,54,5.974699974,2020 218 | Bolivia,Latin America and Caribbean,51,5.89,2015 219 | Bolivia,Latin America and Caribbean,59,5.822,2016 220 | Bolivia,Latin America and Caribbean,58,5.82299995422363,2017 221 | Bolivia,Latin America and Caribbean,62,5.752000000000001,2018 222 | Bolivia,Latin America and Caribbean,61,5.779,2019 223 | Bolivia,Latin America and Caribbean,64,5.747499942999999,2020 224 | Brazil,Latin America and Caribbean,16,6.983,2015 225 | Brazil,Latin America and Caribbean,17,6.952000000000001,2016 226 | Brazil,Latin America and Caribbean,22,6.63500022888184,2017 227 | Brazil,Latin America and Caribbean,28,6.419,2018 228 | Brazil,Latin America and Caribbean,32,6.3,2019 229 | Brazil,Latin America and Caribbean,31,6.375599861,2020 230 | Chile,Latin America and Caribbean,27,6.67,2015 231 | Chile,Latin America and Caribbean,24,6.705,2016 232 | Chile,Latin America and Caribbean,20,6.65199995040894,2017 233 | Chile,Latin America and Caribbean,25,6.476,2018 234 | Chile,Latin America and Caribbean,26,6.444,2019 235 | Chile,Latin America and Caribbean,38,6.228499889,2020 236 | Colombia,Latin America and Caribbean,33,6.477,2015 237 | Colombia,Latin America and Caribbean,31,6.481,2016 238 | Colombia,Latin America and Caribbean,36,6.35699987411499,2017 239 | Colombia,Latin America and Caribbean,37,6.26,2018 240 | Colombia,Latin America and Caribbean,43,6.125,2019 241 | Colombia,Latin America and Caribbean,43,6.163400172999999,2020 242 | Costa Rica,Latin America and Caribbean,12,7.226,2015 243 | Costa Rica,Latin America and Caribbean,14,7.087000000000001,2016 244 | Costa Rica,Latin America and Caribbean,12,7.0789999961853,2017 245 | Costa Rica,Latin America and Caribbean,13,7.072,2018 246 | Costa Rica,Latin America and Caribbean,12,7.167000000000001,2019 247 | Costa Rica,Latin America and Caribbean,14,7.121399879,2020 248 | Dominican Republic,Latin America and Caribbean,98,4.885,2015 249 | Dominican Republic,Latin America and Caribbean,89,5.155,2016 250 | Dominican Republic,Latin America and Caribbean,86,5.230000019073491,2017 251 | Dominican Republic,Latin America and Caribbean,83,5.3020000000000005,2018 252 | Dominican Republic,Latin America and Caribbean,77,5.425,2019 253 | Dominican Republic,Latin America and Caribbean,67,5.689199924,2020 254 | Ecuador,Latin America and Caribbean,48,5.975,2015 255 | Ecuador,Latin America and Caribbean,51,5.976,2016 256 | Ecuador,Latin America and Caribbean,44,6.00799989700317,2017 257 | Ecuador,Latin America and Caribbean,48,5.973,2018 258 | Ecuador,Latin America and Caribbean,50,6.028,2019 259 | Ecuador,Latin America and Caribbean,57,5.925199986,2020 260 | El Salvador,Latin America and Caribbean,42,6.13,2015 261 | El Salvador,Latin America and Caribbean,46,6.068,2016 262 | El Salvador,Latin America and Caribbean,45,6.002999782562259,2017 263 | El Salvador,Latin America and Caribbean,40,6.167000000000001,2018 264 | El Salvador,Latin America and Caribbean,35,6.252999999999999,2019 265 | El Salvador,Latin America and Caribbean,33,6.34829998,2020 266 | Guatemala,Latin America and Caribbean,43,6.122999999999999,2015 267 | Guatemala,Latin America and Caribbean,39,6.324,2016 268 | Guatemala,Latin America and Caribbean,29,6.4539999961853,2017 269 | Guatemala,Latin America and Caribbean,30,6.382000000000001,2018 270 | Guatemala,Latin America and Caribbean,27,6.436,2019 271 | Guatemala,Latin America and Caribbean,28,6.398900032,2020 272 | Honduras,Latin America and Caribbean,105,4.788,2015 273 | Honduras,Latin America and Caribbean,104,4.871,2016 274 | Honduras,Latin America and Caribbean,91,5.1810002326965305,2017 275 | Honduras,Latin America and Caribbean,72,5.504,2018 276 | Honduras,Latin America and Caribbean,59,5.86,2019 277 | Honduras,Latin America and Caribbean,55,5.953199862999999,2020 278 | Jamaica,Latin America and Caribbean,65,5.709,2015 279 | Jamaica,Latin America and Caribbean,73,5.51,2016 280 | Jamaica,Latin America and Caribbean,76,5.31099987030029,2017 281 | Jamaica,Latin America and Caribbean,56,5.89,2018 282 | Jamaica,Latin America and Caribbean,56,5.89,2019 283 | Jamaica,Latin America and Caribbean,59,5.889800072000001,2020 284 | Mexico,Latin America and Caribbean,14,7.187,2015 285 | Mexico,Latin America and Caribbean,21,6.778,2016 286 | Mexico,Latin America and Caribbean,25,6.57800006866455,2017 287 | Mexico,Latin America and Caribbean,24,6.488,2018 288 | Mexico,Latin America and Caribbean,23,6.595,2019 289 | Mexico,Latin America and Caribbean,23,6.465000152999999,2020 290 | Nicaragua,Latin America and Caribbean,57,5.827999999999999,2015 291 | Nicaragua,Latin America and Caribbean,48,5.992000000000001,2016 292 | Nicaragua,Latin America and Caribbean,43,6.07100009918213,2017 293 | Nicaragua,Latin America and Caribbean,41,6.141,2018 294 | Nicaragua,Latin America and Caribbean,45,6.105,2019 295 | Nicaragua,Latin America and Caribbean,45,6.13710022,2020 296 | Panama,Latin America and Caribbean,25,6.7860000000000005,2015 297 | Panama,Latin America and Caribbean,25,6.7010000000000005,2016 298 | Panama,Latin America and Caribbean,30,6.4520001411438,2017 299 | Panama,Latin America and Caribbean,27,6.43,2018 300 | Panama,Latin America and Caribbean,31,6.321000000000001,2019 301 | Panama,Latin America and Caribbean,35,6.304800033999999,2020 302 | Paraguay,Latin America and Caribbean,53,5.877999999999999,2015 303 | Paraguay,Latin America and Caribbean,70,5.537999999999999,2016 304 | Paraguay,Latin America and Caribbean,70,5.493000030517581,2017 305 | Paraguay,Latin America and Caribbean,64,5.681,2018 306 | Paraguay,Latin America and Caribbean,63,5.742999999999999,2019 307 | Paraguay,Latin America and Caribbean,66,5.692100048,2020 308 | Peru,Latin America and Caribbean,58,5.824,2015 309 | Peru,Latin America and Caribbean,64,5.742999999999999,2016 310 | Peru,Latin America and Caribbean,63,5.71500015258789,2017 311 | Peru,Latin America and Caribbean,65,5.662999999999999,2018 312 | Peru,Latin America and Caribbean,65,5.697,2019 313 | Peru,Latin America and Caribbean,62,5.796800137000001,2020 314 | Uruguay,Latin America and Caribbean,32,6.485,2015 315 | Uruguay,Latin America and Caribbean,29,6.545,2016 316 | Uruguay,Latin America and Caribbean,28,6.4539999961853,2017 317 | Uruguay,Latin America and Caribbean,31,6.379,2018 318 | Uruguay,Latin America and Caribbean,33,6.292999999999999,2019 319 | Uruguay,Latin America and Caribbean,25,6.440100192999999,2020 320 | Venezuela,Latin America and Caribbean,23,6.81,2015 321 | Venezuela,Latin America and Caribbean,44,6.084,2016 322 | Venezuela,Latin America and Caribbean,82,5.25,2017 323 | Venezuela,Latin America and Caribbean,102,4.806,2018 324 | Venezuela,Latin America and Caribbean,108,4.707,2019 325 | Venezuela,Latin America and Caribbean,98,5.053199768,2020 326 | Algeria,Middle East and Northern Africa,68,5.605,2015 327 | Algeria,Middle East and Northern Africa,38,6.355,2016 328 | Algeria,Middle East and Northern Africa,53,5.872000217437741,2017 329 | Algeria,Middle East and Northern Africa,84,5.295,2018 330 | Algeria,Middle East and Northern Africa,88,5.211,2019 331 | Algeria,Middle East and Northern Africa,99,5.005099773,2020 332 | Bahrain,Middle East and Northern Africa,49,5.96,2015 333 | Bahrain,Middle East and Northern Africa,42,6.218,2016 334 | Bahrain,Middle East and Northern Africa,41,6.08699989318848,2017 335 | Bahrain,Middle East and Northern Africa,43,6.105,2018 336 | Bahrain,Middle East and Northern Africa,37,6.199,2019 337 | Bahrain,Middle East and Northern Africa,39,6.227300167,2020 338 | Egypt,Middle East and Northern Africa,135,4.194,2015 339 | Egypt,Middle East and Northern Africa,120,4.362,2016 340 | Egypt,Middle East and Northern Africa,104,4.7350001335144,2017 341 | Egypt,Middle East and Northern Africa,122,4.419,2018 342 | Egypt,Middle East and Northern Africa,137,4.166,2019 343 | Egypt,Middle East and Northern Africa,137,4.151400089,2020 344 | Iran,Middle East and Northern Africa,110,4.686,2015 345 | Iran,Middle East and Northern Africa,105,4.813,2016 346 | Iran,Middle East and Northern Africa,108,4.69199991226196,2017 347 | Iran,Middle East and Northern Africa,106,4.707,2018 348 | Iran,Middle East and Northern Africa,117,4.548,2019 349 | Iran,Middle East and Northern Africa,117,4.672399998,2020 350 | Iraq,Middle East and Northern Africa,112,4.677,2015 351 | Iraq,Middle East and Northern Africa,112,4.575,2016 352 | Iraq,Middle East and Northern Africa,117,4.49700021743774,2017 353 | Iraq,Middle East and Northern Africa,117,4.456,2018 354 | Iraq,Middle East and Northern Africa,126,4.437,2019 355 | Iraq,Middle East and Northern Africa,109,4.7848000530000006,2020 356 | Israel,Middle East and Northern Africa,11,7.278,2015 357 | Israel,Middle East and Northern Africa,11,7.267,2016 358 | Israel,Middle East and Northern Africa,11,7.212999820709231,2017 359 | Israel,Middle East and Northern Africa,19,6.814,2018 360 | Israel,Middle East and Northern Africa,13,7.138999999999999,2019 361 | Israel,Middle East and Northern Africa,13,7.128600121,2020 362 | Jordan,Middle East and Northern Africa,82,5.192,2015 363 | Jordan,Middle East and Northern Africa,80,5.303,2016 364 | Jordan,Middle East and Northern Africa,74,5.33599996566772,2017 365 | Jordan,Middle East and Northern Africa,90,5.1610000000000005,2018 366 | Jordan,Middle East and Northern Africa,101,4.906000000000001,2019 367 | Jordan,Middle East and Northern Africa,118,4.6333999630000005,2020 368 | Kuwait,Middle East and Northern Africa,39,6.295,2015 369 | Kuwait,Middle East and Northern Africa,41,6.239,2016 370 | Kuwait,Middle East and Northern Africa,39,6.10500001907349,2017 371 | Kuwait,Middle East and Northern Africa,45,6.082999999999999,2018 372 | Kuwait,Middle East and Northern Africa,51,6.021,2019 373 | Kuwait,Middle East and Northern Africa,47,6.102099895,2020 374 | Lebanon,Middle East and Northern Africa,103,4.839,2015 375 | Lebanon,Middle East and Northern Africa,93,5.129,2016 376 | Lebanon,Middle East and Northern Africa,88,5.22499990463257,2017 377 | Lebanon,Middle East and Northern Africa,80,5.358,2018 378 | Lebanon,Middle East and Northern Africa,91,5.197,2019 379 | Lebanon,Middle East and Northern Africa,110,4.771500111,2020 380 | Libya,Middle East and Northern Africa,63,5.754,2015 381 | Libya,Middle East and Northern Africa,67,5.615,2016 382 | Libya,Middle East and Northern Africa,68,5.525000095367429,2017 383 | Libya,Middle East and Northern Africa,70,5.566,2018 384 | Libya,Middle East and Northern Africa,72,5.525,2019 385 | Libya,Middle East and Northern Africa,79,5.488800049,2020 386 | Morocco,Middle East and Northern Africa,92,5.013,2015 387 | Morocco,Middle East and Northern Africa,90,5.151,2016 388 | Morocco,Middle East and Northern Africa,84,5.2350001335144,2017 389 | Morocco,Middle East and Northern Africa,85,5.254,2018 390 | Morocco,Middle East and Northern Africa,89,5.207999999999999,2019 391 | Morocco,Middle East and Northern Africa,96,5.094799995,2020 392 | Palestinian Territories,Middle East and Northern Africa,108,4.715,2015 393 | Palestinian Territories,Middle East and Northern Africa,108,4.754,2016 394 | Palestinian Territories,Middle East and Northern Africa,103,4.77500009536743,2017 395 | Palestinian Territories,Middle East and Northern Africa,104,4.743,2018 396 | Palestinian Territories,Middle East and Northern Africa,110,4.696000000000001,2019 397 | Palestinian Territories,Middle East and Northern Africa,124,4.552800179,2020 398 | Saudi Arabia,Middle East and Northern Africa,35,6.4110000000000005,2015 399 | Saudi Arabia,Middle East and Northern Africa,34,6.379,2016 400 | Saudi Arabia,Middle East and Northern Africa,37,6.343999862670901,2017 401 | Saudi Arabia,Middle East and Northern Africa,33,6.371,2018 402 | Saudi Arabia,Middle East and Northern Africa,28,6.375,2019 403 | Saudi Arabia,Middle East and Northern Africa,26,6.406499863,2020 404 | Tunisia,Middle East and Northern Africa,107,4.739,2015 405 | Tunisia,Middle East and Northern Africa,98,5.045,2016 406 | Tunisia,Middle East and Northern Africa,102,4.80499982833862,2017 407 | Tunisia,Middle East and Northern Africa,111,4.592,2018 408 | Tunisia,Middle East and Northern Africa,124,4.461,2019 409 | Tunisia,Middle East and Northern Africa,127,4.392199993,2020 410 | Turkey,Middle East and Northern Africa,76,5.332000000000001,2015 411 | Turkey,Middle East and Northern Africa,78,5.388999999999999,2016 412 | Turkey,Middle East and Northern Africa,69,5.5,2017 413 | Turkey,Middle East and Northern Africa,74,5.483,2018 414 | Turkey,Middle East and Northern Africa,79,5.372999999999999,2019 415 | Turkey,Middle East and Northern Africa,92,5.131800175,2020 416 | United Arab Emirates,Middle East and Northern Africa,20,6.901,2015 417 | United Arab Emirates,Middle East and Northern Africa,28,6.573,2016 418 | United Arab Emirates,Middle East and Northern Africa,21,6.6479997634887695,2017 419 | United Arab Emirates,Middle East and Northern Africa,20,6.774,2018 420 | United Arab Emirates,Middle East and Northern Africa,21,6.825,2019 421 | United Arab Emirates,Middle East and Northern Africa,20,6.790800095,2020 422 | Yemen,Middle East and Northern Africa,136,4.077,2015 423 | Yemen,Middle East and Northern Africa,147,3.724,2016 424 | Yemen,Middle East and Northern Africa,146,3.59299993515015,2017 425 | Yemen,Middle East and Northern Africa,152,3.355,2018 426 | Yemen,Middle East and Northern Africa,151,3.38,2019 427 | Yemen,Middle East and Northern Africa,145,3.527400017,2020 428 | Canada,North America,5,7.427,2015 429 | Canada,North America,6,7.404,2016 430 | Canada,North America,7,7.31599998474121,2017 431 | Canada,North America,7,7.327999999999999,2018 432 | Canada,North America,9,7.278,2019 433 | Canada,North America,10,7.23210001,2020 434 | United States,North America,15,7.119,2015 435 | United States,North America,13,7.104,2016 436 | United States,North America,14,6.993000030517581,2017 437 | United States,North America,18,6.886,2018 438 | United States,North America,19,6.892,2019 439 | United States,North America,17,6.939599991000001,2020 440 | Cambodia,Southeastern Asia,145,3.819,2015 441 | Cambodia,Southeastern Asia,140,3.907,2016 442 | Cambodia,Southeastern Asia,129,4.1680002212524405,2017 443 | Cambodia,Southeastern Asia,120,4.433,2018 444 | Cambodia,Southeastern Asia,109,4.7,2019 445 | Cambodia,Southeastern Asia,105,4.8484001160000005,2020 446 | Indonesia,Southeastern Asia,74,5.399,2015 447 | Indonesia,Southeastern Asia,79,5.314,2016 448 | Indonesia,Southeastern Asia,81,5.26200008392334,2017 449 | Indonesia,Southeastern Asia,96,5.093,2018 450 | Indonesia,Southeastern Asia,92,5.192,2019 451 | Indonesia,Southeastern Asia,83,5.285600185,2020 452 | Malaysia,Southeastern Asia,61,5.77,2015 453 | Malaysia,Southeastern Asia,47,6.005,2016 454 | Malaysia,Southeastern Asia,42,6.08400011062622,2017 455 | Malaysia,Southeastern Asia,35,6.322,2018 456 | Malaysia,Southeastern Asia,80,5.339,2019 457 | Malaysia,Southeastern Asia,81,5.384300232,2020 458 | Myanmar,Southeastern Asia,129,4.307,2015 459 | Myanmar,Southeastern Asia,119,4.395,2016 460 | Myanmar,Southeastern Asia,114,4.54500007629395,2017 461 | Myanmar,Southeastern Asia,130,4.308,2018 462 | Myanmar,Southeastern Asia,131,4.36,2019 463 | Myanmar,Southeastern Asia,132,4.308000088,2020 464 | Philippines,Southeastern Asia,90,5.073,2015 465 | Philippines,Southeastern Asia,82,5.279,2016 466 | Philippines,Southeastern Asia,72,5.42999982833862,2017 467 | Philippines,Southeastern Asia,71,5.524,2018 468 | Philippines,Southeastern Asia,69,5.631,2019 469 | Philippines,Southeastern Asia,51,6.006000042,2020 470 | Singapore,Southeastern Asia,24,6.797999999999999,2015 471 | Singapore,Southeastern Asia,22,6.739,2016 472 | Singapore,Southeastern Asia,26,6.57200002670288,2017 473 | Singapore,Southeastern Asia,34,6.343,2018 474 | Singapore,Southeastern Asia,34,6.2620000000000005,2019 475 | Singapore,Southeastern Asia,30,6.377099991000001,2020 476 | Thailand,Southeastern Asia,34,6.455,2015 477 | Thailand,Southeastern Asia,33,6.474,2016 478 | Thailand,Southeastern Asia,32,6.423999786376951,2017 479 | Thailand,Southeastern Asia,46,6.072,2018 480 | Thailand,Southeastern Asia,52,6.007999999999999,2019 481 | Thailand,Southeastern Asia,53,5.9987998010000005,2020 482 | Vietnam,Southeastern Asia,75,5.36,2015 483 | Vietnam,Southeastern Asia,96,5.061,2016 484 | Vietnam,Southeastern Asia,94,5.07399988174438,2017 485 | Vietnam,Southeastern Asia,95,5.103,2018 486 | Vietnam,Southeastern Asia,94,5.175,2019 487 | Vietnam,Southeastern Asia,82,5.353499889,2020 488 | Afghanistan,Southern Asia,153,3.575,2015 489 | Afghanistan,Southern Asia,154,3.36,2016 490 | Afghanistan,Southern Asia,141,3.79399991035461,2017 491 | Afghanistan,Southern Asia,145,3.632,2018 492 | Afghanistan,Southern Asia,154,3.2030000000000003,2019 493 | Afghanistan,Southern Asia,152,2.566900015,2020 494 | Bangladesh,Southern Asia,109,4.694,2015 495 | Bangladesh,Southern Asia,110,4.643,2016 496 | Bangladesh,Southern Asia,110,4.60799980163574,2017 497 | Bangladesh,Southern Asia,115,4.5,2018 498 | Bangladesh,Southern Asia,125,4.456,2019 499 | Bangladesh,Southern Asia,106,4.832799911,2020 500 | India,Southern Asia,117,4.565,2015 501 | India,Southern Asia,118,4.404,2016 502 | India,Southern Asia,122,4.31500005722046,2017 503 | India,Southern Asia,133,4.19,2018 504 | India,Southern Asia,140,4.015,2019 505 | India,Southern Asia,143,3.573299885,2020 506 | Nepal,Southern Asia,121,4.513999999999999,2015 507 | Nepal,Southern Asia,107,4.793,2016 508 | Nepal,Southern Asia,99,4.961999893188481,2017 509 | Nepal,Southern Asia,101,4.88,2018 510 | Nepal,Southern Asia,100,4.913,2019 511 | Nepal,Southern Asia,91,5.137199879,2020 512 | Pakistan,Southern Asia,81,5.194,2015 513 | Pakistan,Southern Asia,92,5.132000000000001,2016 514 | Pakistan,Southern Asia,80,5.26900005340576,2017 515 | Pakistan,Southern Asia,75,5.472,2018 516 | Pakistan,Southern Asia,67,5.653,2019 517 | Pakistan,Southern Asia,65,5.69329977,2020 518 | Sri Lanka,Southern Asia,132,4.271,2015 519 | Sri Lanka,Southern Asia,117,4.415,2016 520 | Sri Lanka,Southern Asia,120,4.44000005722046,2017 521 | Sri Lanka,Southern Asia,116,4.471,2018 522 | Sri Lanka,Southern Asia,130,4.3660000000000005,2019 523 | Sri Lanka,Southern Asia,129,4.327000141,2020 524 | Benin,Sub-Saharan Africa,155,3.34,2015 525 | Benin,Sub-Saharan Africa,153,3.484,2016 526 | Benin,Sub-Saharan Africa,143,3.65700006484985,2017 527 | Benin,Sub-Saharan Africa,136,4.141,2018 528 | Benin,Sub-Saharan Africa,102,4.883,2019 529 | Benin,Sub-Saharan Africa,85,5.21600008,2020 530 | Botswana,Sub-Saharan Africa,128,4.332,2015 531 | Botswana,Sub-Saharan Africa,137,3.974,2016 532 | Botswana,Sub-Saharan Africa,142,3.7660000324249294,2017 533 | Botswana,Sub-Saharan Africa,146,3.59,2018 534 | Botswana,Sub-Saharan Africa,148,3.488,2019 535 | Botswana,Sub-Saharan Africa,146,3.478899956,2020 536 | Burkina Faso,Sub-Saharan Africa,152,3.587,2015 537 | Burkina Faso,Sub-Saharan Africa,145,3.739,2016 538 | Burkina Faso,Sub-Saharan Africa,134,4.03200006484985,2017 539 | Burkina Faso,Sub-Saharan Africa,121,4.424,2018 540 | Burkina Faso,Sub-Saharan Africa,115,4.587,2019 541 | Burkina Faso,Sub-Saharan Africa,111,4.768700123,2020 542 | Cameroon,Sub-Saharan Africa,133,4.252,2015 543 | Cameroon,Sub-Saharan Africa,114,4.513,2016 544 | Cameroon,Sub-Saharan Africa,107,4.69500017166138,2017 545 | Cameroon,Sub-Saharan Africa,99,4.975,2018 546 | Cameroon,Sub-Saharan Africa,96,5.044,2019 547 | Cameroon,Sub-Saharan Africa,97,5.084899902,2020 548 | Chad,Sub-Saharan Africa,149,3.667,2015 549 | Chad,Sub-Saharan Africa,144,3.763,2016 550 | Chad,Sub-Saharan Africa,137,3.9360001087188703,2017 551 | Chad,Sub-Saharan Africa,131,4.301,2018 552 | Chad,Sub-Saharan Africa,132,4.35,2019 553 | Chad,Sub-Saharan Africa,126,4.422699928,2020 554 | Ethiopia,Sub-Saharan Africa,122,4.512,2015 555 | Ethiopia,Sub-Saharan Africa,115,4.508,2016 556 | Ethiopia,Sub-Saharan Africa,119,4.46000003814697,2017 557 | Ethiopia,Sub-Saharan Africa,127,4.35,2018 558 | Ethiopia,Sub-Saharan Africa,134,4.2860000000000005,2019 559 | Ethiopia,Sub-Saharan Africa,135,4.186200142,2020 560 | Gabon,Sub-Saharan Africa,143,3.896,2015 561 | Gabon,Sub-Saharan Africa,134,4.121,2016 562 | Gabon,Sub-Saharan Africa,118,4.46500015258789,2017 563 | Gabon,Sub-Saharan Africa,103,4.758,2018 564 | Gabon,Sub-Saharan Africa,104,4.799,2019 565 | Gabon,Sub-Saharan Africa,107,4.829299927,2020 566 | Ghana,Sub-Saharan Africa,114,4.633,2015 567 | Ghana,Sub-Saharan Africa,124,4.276,2016 568 | Ghana,Sub-Saharan Africa,131,4.11999988555908,2017 569 | Ghana,Sub-Saharan Africa,108,4.657,2018 570 | Ghana,Sub-Saharan Africa,98,4.996,2019 571 | Ghana,Sub-Saharan Africa,90,5.1479997630000005,2020 572 | Guinea,Sub-Saharan Africa,150,3.656,2015 573 | Guinea,Sub-Saharan Africa,151,3.607,2016 574 | Guinea,Sub-Saharan Africa,149,3.50699996948242,2017 575 | Guinea,Sub-Saharan Africa,140,3.964,2018 576 | Guinea,Sub-Saharan Africa,118,4.534,2019 577 | Guinea,Sub-Saharan Africa,101,4.949299812,2020 578 | Ivory Coast,Sub-Saharan Africa,151,3.655,2015 579 | Ivory Coast,Sub-Saharan Africa,139,3.916,2016 580 | Ivory Coast,Sub-Saharan Africa,128,4.17999982833862,2017 581 | Ivory Coast,Sub-Saharan Africa,107,4.671,2018 582 | Ivory Coast,Sub-Saharan Africa,99,4.944,2019 583 | Ivory Coast,Sub-Saharan Africa,84,5.233300208999999,2020 584 | Kenya,Sub-Saharan Africa,125,4.419,2015 585 | Kenya,Sub-Saharan Africa,122,4.356,2016 586 | Kenya,Sub-Saharan Africa,112,4.55299997329712,2017 587 | Kenya,Sub-Saharan Africa,124,4.41,2018 588 | Kenya,Sub-Saharan Africa,121,4.509,2019 589 | Kenya,Sub-Saharan Africa,120,4.583000183,2020 590 | Liberia,Sub-Saharan Africa,116,4.571000000000001,2015 591 | Liberia,Sub-Saharan Africa,150,3.622,2016 592 | Liberia,Sub-Saharan Africa,148,3.532999992370609,2017 593 | Liberia,Sub-Saharan Africa,149,3.495,2018 594 | Liberia,Sub-Saharan Africa,141,3.975,2019 595 | Liberia,Sub-Saharan Africa,123,4.557899952,2020 596 | Madagascar,Sub-Saharan Africa,147,3.681,2015 597 | Madagascar,Sub-Saharan Africa,148,3.695,2016 598 | Madagascar,Sub-Saharan Africa,144,3.64400005340576,2017 599 | Madagascar,Sub-Saharan Africa,143,3.774,2018 600 | Madagascar,Sub-Saharan Africa,143,3.933,2019 601 | Madagascar,Sub-Saharan Africa,136,4.165599823,2020 602 | Malawi,Sub-Saharan Africa,131,4.292,2015 603 | Malawi,Sub-Saharan Africa,132,4.156000000000001,2016 604 | Malawi,Sub-Saharan Africa,136,3.97000002861023,2017 605 | Malawi,Sub-Saharan Africa,147,3.587,2018 606 | Malawi,Sub-Saharan Africa,150,3.41,2019 607 | Malawi,Sub-Saharan Africa,144,3.538000107,2020 608 | Mali,Sub-Saharan Africa,138,3.995,2015 609 | Mali,Sub-Saharan Africa,135,4.073,2016 610 | Mali,Sub-Saharan Africa,127,4.19000005722046,2017 611 | Mali,Sub-Saharan Africa,118,4.447,2018 612 | Mali,Sub-Saharan Africa,128,4.39,2019 613 | Mali,Sub-Saharan Africa,113,4.729300021999999,2020 614 | Mauritania,Sub-Saharan Africa,124,4.436,2015 615 | Mauritania,Sub-Saharan Africa,130,4.2010000000000005,2016 616 | Mauritania,Sub-Saharan Africa,123,4.29199981689453,2017 617 | Mauritania,Sub-Saharan Africa,126,4.356,2018 618 | Mauritania,Sub-Saharan Africa,122,4.49,2019 619 | Mauritania,Sub-Saharan Africa,128,4.374599934,2020 620 | Mauritius,Sub-Saharan Africa,71,5.477,2015 621 | Mauritius,Sub-Saharan Africa,66,5.648,2016 622 | Mauritius,Sub-Saharan Africa,64,5.62900018692017,2017 623 | Mauritius,Sub-Saharan Africa,55,5.891,2018 624 | Mauritius,Sub-Saharan Africa,57,5.888,2019 625 | Mauritius,Sub-Saharan Africa,48,6.101299762999999,2020 626 | Niger,Sub-Saharan Africa,144,3.845,2015 627 | Niger,Sub-Saharan Africa,142,3.856,2016 628 | Niger,Sub-Saharan Africa,135,4.02799987792969,2017 629 | Niger,Sub-Saharan Africa,134,4.166,2018 630 | Niger,Sub-Saharan Africa,114,4.628,2019 631 | Niger,Sub-Saharan Africa,102,4.909599781,2020 632 | Nigeria,Sub-Saharan Africa,78,5.268,2015 633 | Nigeria,Sub-Saharan Africa,103,4.875,2016 634 | Nigeria,Sub-Saharan Africa,95,5.07399988174438,2017 635 | Nigeria,Sub-Saharan Africa,91,5.155,2018 636 | Nigeria,Sub-Saharan Africa,85,5.265,2019 637 | Nigeria,Sub-Saharan Africa,114,4.724100113,2020 638 | Rwanda,Sub-Saharan Africa,154,3.465,2015 639 | Rwanda,Sub-Saharan Africa,152,3.515,2016 640 | Rwanda,Sub-Saharan Africa,151,3.47099995613098,2017 641 | Rwanda,Sub-Saharan Africa,151,3.408,2018 642 | Rwanda,Sub-Saharan Africa,152,3.334,2019 643 | Rwanda,Sub-Saharan Africa,149,3.312299967,2020 644 | Senegal,Sub-Saharan Africa,142,3.904,2015 645 | Senegal,Sub-Saharan Africa,128,4.218999999999999,2016 646 | Senegal,Sub-Saharan Africa,115,4.53499984741211,2017 647 | Senegal,Sub-Saharan Africa,109,4.631,2018 648 | Senegal,Sub-Saharan Africa,111,4.681,2019 649 | Senegal,Sub-Saharan Africa,100,4.980800152,2020 650 | Sierra Leone,Sub-Saharan Africa,123,4.507,2015 651 | Sierra Leone,Sub-Saharan Africa,111,4.635,2016 652 | Sierra Leone,Sub-Saharan Africa,106,4.70900011062622,2017 653 | Sierra Leone,Sub-Saharan Africa,113,4.571000000000001,2018 654 | Sierra Leone,Sub-Saharan Africa,129,4.374,2019 655 | Sierra Leone,Sub-Saharan Africa,138,3.926399946,2020 656 | South Africa,Sub-Saharan Africa,113,4.642,2015 657 | South Africa,Sub-Saharan Africa,116,4.459,2016 658 | South Africa,Sub-Saharan Africa,101,4.8289999961853,2017 659 | South Africa,Sub-Saharan Africa,105,4.724,2018 660 | South Africa,Sub-Saharan Africa,106,4.722,2019 661 | South Africa,Sub-Saharan Africa,108,4.814099789,2020 662 | Tanzania,Sub-Saharan Africa,146,3.781,2015 663 | Tanzania,Sub-Saharan Africa,149,3.666,2016 664 | Tanzania,Sub-Saharan Africa,153,3.34899997711182,2017 665 | Tanzania,Sub-Saharan Africa,153,3.303,2018 666 | Tanzania,Sub-Saharan Africa,153,3.2310000000000003,2019 667 | Tanzania,Sub-Saharan Africa,147,3.476200104,2020 668 | Togo,Sub-Saharan Africa,158,2.839,2015 669 | Togo,Sub-Saharan Africa,155,3.303,2016 670 | Togo,Sub-Saharan Africa,150,3.4949998855590803,2017 671 | Togo,Sub-Saharan Africa,139,3.999,2018 672 | Togo,Sub-Saharan Africa,139,4.085,2019 673 | Togo,Sub-Saharan Africa,134,4.187200069,2020 674 | Uganda,Sub-Saharan Africa,141,3.931,2015 675 | Uganda,Sub-Saharan Africa,145,3.739,2016 676 | Uganda,Sub-Saharan Africa,133,4.08099985122681,2017 677 | Uganda,Sub-Saharan Africa,135,4.1610000000000005,2018 678 | Uganda,Sub-Saharan Africa,136,4.189,2019 679 | Uganda,Sub-Saharan Africa,125,4.43200016,2020 680 | Zambia,Sub-Saharan Africa,85,5.129,2015 681 | Zambia,Sub-Saharan Africa,106,4.795,2016 682 | Zambia,Sub-Saharan Africa,116,4.513999938964839,2017 683 | Zambia,Sub-Saharan Africa,125,4.377,2018 684 | Zambia,Sub-Saharan Africa,138,4.107,2019 685 | Zambia,Sub-Saharan Africa,140,3.759399891,2020 686 | Zimbabwe,Sub-Saharan Africa,115,4.61,2015 687 | Zimbabwe,Sub-Saharan Africa,131,4.1930000000000005,2016 688 | Zimbabwe,Sub-Saharan Africa,138,3.875,2017 689 | Zimbabwe,Sub-Saharan Africa,144,3.692,2018 690 | Zimbabwe,Sub-Saharan Africa,146,3.663,2019 691 | Zimbabwe,Sub-Saharan Africa,150,3.2992000580000003,2020 692 | Austria,Western Europe,13,7.2,2015 693 | Austria,Western Europe,12,7.119,2016 694 | Austria,Western Europe,13,7.00600004196167,2017 695 | Austria,Western Europe,12,7.138999999999999,2018 696 | Austria,Western Europe,10,7.246,2019 697 | Austria,Western Europe,8,7.294199944,2020 698 | Belgium,Western Europe,19,6.937,2015 699 | Belgium,Western Europe,18,6.928999999999999,2016 700 | Belgium,Western Europe,17,6.89099979400635,2017 701 | Belgium,Western Europe,16,6.9270000000000005,2018 702 | Belgium,Western Europe,18,6.922999999999999,2019 703 | Belgium,Western Europe,19,6.863500117999999,2020 704 | Cyprus,Western Europe,67,5.689,2015 705 | Cyprus,Western Europe,69,5.546,2016 706 | Cyprus,Western Europe,65,5.62099981307983,2017 707 | Cyprus,Western Europe,61,5.7620000000000005,2018 708 | Cyprus,Western Europe,49,6.046,2019 709 | Cyprus,Western Europe,44,6.15899992,2020 710 | Denmark,Western Europe,3,7.527,2015 711 | Denmark,Western Europe,1,7.526,2016 712 | Denmark,Western Europe,2,7.52199983596802,2017 713 | Denmark,Western Europe,3,7.555,2018 714 | Denmark,Western Europe,2,7.6,2019 715 | Denmark,Western Europe,1,7.645599842,2020 716 | Finland,Western Europe,6,7.406000000000001,2015 717 | Finland,Western Europe,5,7.412999999999999,2016 718 | Finland,Western Europe,5,7.468999862670901,2017 719 | Finland,Western Europe,1,7.632000000000001,2018 720 | Finland,Western Europe,1,7.769,2019 721 | Finland,Western Europe,0,7.808700085,2020 722 | France,Western Europe,29,6.575,2015 723 | France,Western Europe,32,6.478,2016 724 | France,Western Europe,31,6.44199991226196,2017 725 | France,Western Europe,23,6.489,2018 726 | France,Western Europe,24,6.5920000000000005,2019 727 | France,Western Europe,22,6.663799762999999,2020 728 | Germany,Western Europe,26,6.75,2015 729 | Germany,Western Europe,16,6.994,2016 730 | Germany,Western Europe,16,6.9510002136230495,2017 731 | Germany,Western Europe,15,6.965,2018 732 | Germany,Western Europe,17,6.985,2019 733 | Germany,Western Europe,16,7.075799942000001,2020 734 | Greece,Western Europe,102,4.857,2015 735 | Greece,Western Europe,99,5.033,2016 736 | Greece,Western Europe,87,5.227000236511231,2017 737 | Greece,Western Europe,79,5.358,2018 738 | Greece,Western Europe,82,5.287000000000001,2019 739 | Greece,Western Europe,76,5.514999866,2020 740 | Iceland,Western Europe,2,7.561,2015 741 | Iceland,Western Europe,3,7.501,2016 742 | Iceland,Western Europe,3,7.50400018692017,2017 743 | Iceland,Western Europe,4,7.495,2018 744 | Iceland,Western Europe,4,7.494,2019 745 | Iceland,Western Europe,3,7.504499912000001,2020 746 | Ireland,Western Europe,18,6.94,2015 747 | Ireland,Western Europe,19,6.907,2016 748 | Ireland,Western Europe,15,6.977000236511231,2017 749 | Ireland,Western Europe,14,6.977,2018 750 | Ireland,Western Europe,16,7.021,2019 751 | Ireland,Western Europe,15,7.093699932000001,2020 752 | Italy,Western Europe,50,5.948,2015 753 | Italy,Western Europe,50,5.977,2016 754 | Italy,Western Europe,48,5.96400022506714,2017 755 | Italy,Western Europe,47,6.0,2018 756 | Italy,Western Europe,36,6.223,2019 757 | Italy,Western Europe,29,6.38740015,2020 758 | Luxembourg,Western Europe,17,6.946000000000001,2015 759 | Luxembourg,Western Europe,20,6.871,2016 760 | Luxembourg,Western Europe,18,6.86299991607666,2017 761 | Luxembourg,Western Europe,17,6.91,2018 762 | Luxembourg,Western Europe,14,7.09,2019 763 | Luxembourg,Western Europe,9,7.237500191,2020 764 | Malta,Western Europe,37,6.3020000000000005,2015 765 | Malta,Western Europe,30,6.488,2016 766 | Malta,Western Europe,27,6.52699995040894,2017 767 | Malta,Western Europe,22,6.627000000000001,2018 768 | Malta,Western Europe,22,6.726,2019 769 | Malta,Western Europe,21,6.772799968999999,2020 770 | Netherlands,Western Europe,7,7.377999999999999,2015 771 | Netherlands,Western Europe,7,7.338999999999999,2016 772 | Netherlands,Western Europe,6,7.3769998550415,2017 773 | Netherlands,Western Europe,6,7.441,2018 774 | Netherlands,Western Europe,5,7.487999999999999,2019 775 | Netherlands,Western Europe,5,7.448900223,2020 776 | North Cyprus,Western Europe,66,5.695,2015 777 | North Cyprus,Western Europe,62,5.771,2016 778 | North Cyprus,Western Europe,61,5.80999994277954,2017 779 | North Cyprus,Western Europe,58,5.835,2018 780 | North Cyprus,Western Europe,64,5.718,2019 781 | North Cyprus,Western Europe,75,5.53550005,2020 782 | Norway,Western Europe,4,7.522,2015 783 | Norway,Western Europe,4,7.497999999999999,2016 784 | Norway,Western Europe,1,7.537000179290769,2017 785 | Norway,Western Europe,2,7.593999999999999,2018 786 | Norway,Western Europe,3,7.553999999999999,2019 787 | Norway,Western Europe,4,7.487999916000001,2020 788 | Portugal,Western Europe,88,5.102,2015 789 | Portugal,Western Europe,94,5.122999999999999,2016 790 | Portugal,Western Europe,89,5.19500017166138,2017 791 | Portugal,Western Europe,77,5.41,2018 792 | Portugal,Western Europe,66,5.693,2019 793 | Portugal,Western Europe,58,5.9109001160000005,2020 794 | Spain,Western Europe,36,6.329,2015 795 | Spain,Western Europe,37,6.361000000000001,2016 796 | Spain,Western Europe,34,6.40299987792969,2017 797 | Spain,Western Europe,36,6.31,2018 798 | Spain,Western Europe,30,6.354,2019 799 | Spain,Western Europe,27,6.4008998870000005,2020 800 | Sweden,Western Europe,8,7.364,2015 801 | Sweden,Western Europe,10,7.291,2016 802 | Sweden,Western Europe,9,7.28399991989136,2017 803 | Sweden,Western Europe,9,7.314,2018 804 | Sweden,Western Europe,7,7.343,2019 805 | Sweden,Western Europe,6,7.353499889,2020 806 | Switzerland,Western Europe,1,7.587000000000001,2015 807 | Switzerland,Western Europe,2,7.508999999999999,2016 808 | Switzerland,Western Europe,4,7.49399995803833,2017 809 | Switzerland,Western Europe,5,7.487,2018 810 | Switzerland,Western Europe,6,7.48,2019 811 | Switzerland,Western Europe,2,7.559899807000001,2020 812 | United Kingdom,Western Europe,21,6.867000000000001,2015 813 | United Kingdom,Western Europe,23,6.725,2016 814 | United Kingdom,Western Europe,19,6.71400022506714,2017 815 | United Kingdom,Western Europe,11,7.19,2018 816 | United Kingdom,Western Europe,15,7.053999999999999,2019 817 | United Kingdom,Western Europe,12,7.164500237,2020 818 | Finland,Western Europe,1,7.842,2021 819 | Denmark,Western Europe,2,7.62,2021 820 | Switzerland,Western Europe,3,7.571,2021 821 | Iceland,Western Europe,4,7.554,2021 822 | Netherlands,Western Europe,5,7.464,2021 823 | Norway,Western Europe,6,7.392,2021 824 | Sweden,Western Europe,7,7.363,2021 825 | Luxembourg,Western Europe,8,7.324,2021 826 | New Zealand,Australia and New Zealand,9,7.277,2021 827 | Austria,Western Europe,10,7.268,2021 828 | Australia,Australia and New Zealand,11,7.183,2021 829 | Israel,Middle East and Northern Africa,12,7.157,2021 830 | Germany,Western Europe,13,7.155,2021 831 | Canada,North America,14,7.103,2021 832 | Ireland,Western Europe,15,7.085,2021 833 | Costa Rica,Latin America and Caribbean,16,7.069,2021 834 | United Kingdom,Western Europe,17,7.064,2021 835 | Czech Republic,Central and Eastern Europe,18,6.965,2021 836 | United States,North America,19,6.951,2021 837 | Belgium,Western Europe,20,6.834,2021 838 | France,Western Europe,21,6.69,2021 839 | Bahrain,Middle East and Northern Africa,22,6.647,2021 840 | Malta,Western Europe,23,6.602,2021 841 | Taiwan,Eastern Asia,24,6.584,2021 842 | United Arab Emirates,Middle East and Northern Africa,25,6.561,2021 843 | Saudi Arabia,Middle East and Northern Africa,26,6.494,2021 844 | Spain,Western Europe,27,6.491,2021 845 | Italy,Western Europe,28,6.483,2021 846 | Slovenia,Central and Eastern Europe,29,6.461,2021 847 | Guatemala,Latin America and Caribbean,30,6.435,2021 848 | Uruguay,Latin America and Caribbean,31,6.431,2021 849 | Singapore,Southeastern Asia,32,6.377,2021 850 | Kosovo,Central and Eastern Europe,33,6.372,2021 851 | Slovakia,Central and Eastern Europe,34,6.331,2021 852 | Brazil,Latin America and Caribbean,35,6.33,2021 853 | Mexico,Latin America and Caribbean,36,6.317,2021 854 | Jamaica,Latin America and Caribbean,37,6.309,2021 855 | Lithuania,Central and Eastern Europe,38,6.255,2021 856 | Cyprus,Western Europe,39,6.223,2021 857 | Estonia,Central and Eastern Europe,40,6.189,2021 858 | Panama,Latin America and Caribbean,41,6.18,2021 859 | Uzbekistan,Central and Eastern Europe,42,6.179,2021 860 | Chile,Latin America and Caribbean,43,6.172,2021 861 | Poland,Central and Eastern Europe,44,6.166,2021 862 | Kazakhstan,Central and Eastern Europe,45,6.152,2021 863 | Romania,Central and Eastern Europe,46,6.14,2021 864 | Kuwait,Middle East and Northern Africa,47,6.106,2021 865 | Serbia,Central and Eastern Europe,48,6.078,2021 866 | El Salvador,Latin America and Caribbean,49,6.061,2021 867 | Mauritius,Sub-Saharan Africa,50,6.049,2021 868 | Latvia,Central and Eastern Europe,51,6.032,2021 869 | Colombia,Latin America and Caribbean,52,6.012,2021 870 | Hungary,Central and Eastern Europe,53,5.992,2021 871 | Thailand,Southeastern Asia,54,5.985,2021 872 | Nicaragua,Latin America and Caribbean,55,5.972,2021 873 | Japan,Eastern Asia,56,5.94,2021 874 | Portugal,Western Europe,57,5.929,2021 875 | Argentina,Latin America and Caribbean,58,5.929,2021 876 | Honduras,Latin America and Caribbean,59,5.919,2021 877 | Croatia,Central and Eastern Europe,60,5.882,2021 878 | Philippines,Southeastern Asia,61,5.88,2021 879 | South Korea,Eastern Asia,62,5.845,2021 880 | Peru,Latin America and Caribbean,63,5.84,2021 881 | Bosnia and Herzegovina,Central and Eastern Europe,64,5.813,2021 882 | Moldova,Central and Eastern Europe,65,5.766,2021 883 | Ecuador,Latin America and Caribbean,66,5.764,2021 884 | Kyrgyzstan,Central and Eastern Europe,67,5.744,2021 885 | Greece,Western Europe,68,5.723,2021 886 | Bolivia,Latin America and Caribbean,69,5.716,2021 887 | Mongolia,Eastern Asia,70,5.677,2021 888 | Paraguay,Latin America and Caribbean,71,5.653,2021 889 | Montenegro,Central and Eastern Europe,72,5.581,2021 890 | Dominican Republic,Latin America and Caribbean,73,5.545,2021 891 | North Cyprus,Western Europe,74,5.536,2021 892 | Belarus,Central and Eastern Europe,75,5.534,2021 893 | Russia,Central and Eastern Europe,76,5.477,2021 894 | Tajikistan,Central and Eastern Europe,78,5.466,2021 895 | Vietnam,Southeastern Asia,79,5.411,2021 896 | Libya,Middle East and Northern Africa,80,5.41,2021 897 | Malaysia,Southeastern Asia,81,5.384,2021 898 | Indonesia,Southeastern Asia,82,5.345,2021 899 | China,Eastern Asia,84,5.339,2021 900 | Ivory Coast,Sub-Saharan Africa,85,5.306,2021 901 | Armenia,Central and Eastern Europe,86,5.283,2021 902 | Nepal,Southern Asia,87,5.269,2021 903 | Bulgaria,Central and Eastern Europe,88,5.266,2021 904 | Azerbaijan,Central and Eastern Europe,90,5.171,2021 905 | Cameroon,Sub-Saharan Africa,91,5.142,2021 906 | Senegal,Sub-Saharan Africa,92,5.132,2021 907 | Albania,Central and Eastern Europe,93,5.117,2021 908 | Ghana,Sub-Saharan Africa,95,5.088,2021 909 | Niger,Sub-Saharan Africa,96,5.074,2021 910 | Turkmenistan,Central and Eastern Europe,97,5.066,2021 911 | Benin,Sub-Saharan Africa,99,5.045,2021 912 | Bangladesh,Southern Asia,101,5.025,2021 913 | Guinea,Sub-Saharan Africa,102,4.984,2021 914 | South Africa,Sub-Saharan Africa,103,4.956,2021 915 | Turkey,Middle East and Northern Africa,104,4.948,2021 916 | Pakistan,Southern Asia,105,4.934,2021 917 | Morocco,Middle East and Northern Africa,106,4.918,2021 918 | Venezuela,Latin America and Caribbean,107,4.892,2021 919 | Georgia,Central and Eastern Europe,108,4.891,2021 920 | Algeria,Middle East and Northern Africa,109,4.887,2021 921 | Ukraine,Central and Eastern Europe,110,4.875,2021 922 | Iraq,Middle East and Northern Africa,111,4.854,2021 923 | Gabon,Sub-Saharan Africa,112,4.852,2021 924 | Burkina Faso,Sub-Saharan Africa,113,4.834,2021 925 | Cambodia,Southeastern Asia,114,4.83,2021 926 | Nigeria,Sub-Saharan Africa,116,4.759,2021 927 | Mali,Sub-Saharan Africa,117,4.723,2021 928 | Iran,Middle East and Northern Africa,118,4.721,2021 929 | Uganda,Sub-Saharan Africa,119,4.636,2021 930 | Liberia,Sub-Saharan Africa,120,4.625,2021 931 | Kenya,Sub-Saharan Africa,121,4.607,2021 932 | Tunisia,Middle East and Northern Africa,122,4.596,2021 933 | Lebanon,Middle East and Northern Africa,123,4.584,2021 934 | Palestinian Territories,Middle East and Northern Africa,125,4.517,2021 935 | Myanmar,Southeastern Asia,126,4.426,2021 936 | Jordan,Middle East and Northern Africa,127,4.395,2021 937 | Chad,Sub-Saharan Africa,128,4.355,2021 938 | Sri Lanka,Southern Asia,129,4.325,2021 939 | Egypt,Middle East and Northern Africa,132,4.283,2021 940 | Ethiopia,Sub-Saharan Africa,133,4.275,2021 941 | Mauritania,Sub-Saharan Africa,134,4.227,2021 942 | Madagascar,Sub-Saharan Africa,135,4.208,2021 943 | Togo,Sub-Saharan Africa,136,4.107,2021 944 | Zambia,Sub-Saharan Africa,137,4.073,2021 945 | Sierra Leone,Sub-Saharan Africa,138,3.849,2021 946 | India,Southern Asia,139,3.819,2021 947 | Yemen,Middle East and Northern Africa,141,3.658,2021 948 | Tanzania,Sub-Saharan Africa,142,3.623,2021 949 | Malawi,Sub-Saharan Africa,144,3.6,2021 950 | Botswana,Sub-Saharan Africa,146,3.467,2021 951 | Rwanda,Sub-Saharan Africa,147,3.415,2021 952 | Zimbabwe,Sub-Saharan Africa,148,3.145,2021 953 | Afghanistan,Southern Asia,149,2.523,2021 954 | Finland,Western Europe,1,7.821,2022 955 | Denmark,Western Europe,2,7.636,2022 956 | Iceland,Western Europe,3,7.557,2022 957 | Switzerland,Western Europe,4,7.512,2022 958 | Netherlands,Western Europe,5,7.415,2022 959 | Luxembourg,Western Europe,6,7.404,2022 960 | Sweden,Western Europe,7,7.384,2022 961 | Norway,Western Europe,8,7.365,2022 962 | Israel,Middle East and Northern Africa,9,7.364,2022 963 | New Zealand,Australia and New Zealand,10,7.2,2022 964 | Austria,Western Europe,11,7.163,2022 965 | Australia,Australia and New Zealand,12,7.162,2022 966 | Ireland,Western Europe,13,7.041,2022 967 | Germany,Western Europe,14,7.034,2022 968 | Canada,North America,15,7.025,2022 969 | United States,North America,16,6.977,2022 970 | United Kingdom,Western Europe,17,6.943,2022 971 | Czech Republic,Central and Eastern Europe,18,6.92,2022 972 | Belgium,Western Europe,19,6.805,2022 973 | France,Western Europe,20,6.687,2022 974 | Bahrain,Middle East and Northern Africa,21,6.647,2022 975 | Slovenia,Central and Eastern Europe,22,6.63,2022 976 | Costa Rica,Latin America and Caribbean,23,6.582,2022 977 | United Arab Emirates,Middle East and Northern Africa,24,6.576,2022 978 | Saudi Arabia,Middle East and Northern Africa,25,6.523,2022 979 | Taiwan,Eastern Asia,26,6.512,2022 980 | Singapore,Southeastern Asia,27,6.48,2022 981 | Romania,Central and Eastern Europe,28,6.477,2022 982 | Spain,Western Europe,29,6.476,2022 983 | Uruguay,Latin America and Caribbean,30,6.474,2022 984 | Italy,Western Europe,31,6.467,2022 985 | Kosovo,Central and Eastern Europe,32,6.455,2022 986 | Malta,Western Europe,33,6.447,2022 987 | Lithuania,Central and Eastern Europe,34,6.446,2022 988 | Slovakia,Central and Eastern Europe,35,6.391,2022 989 | Estonia,Central and Eastern Europe,36,6.341,2022 990 | Panama,Latin America and Caribbean,37,6.309,2022 991 | Brazil,Latin America and Caribbean,38,6.293,2022 992 | Guatemala,Latin America and Caribbean,39,6.262,2022 993 | Kazakhstan,Central and Eastern Europe,40,6.234,2022 994 | Cyprus,Western Europe,41,6.221,2022 995 | Latvia,Central and Eastern Europe,42,6.18,2022 996 | Serbia,Central and Eastern Europe,43,6.178,2022 997 | Chile,Latin America and Caribbean,44,6.172,2022 998 | Nicaragua,Latin America and Caribbean,45,6.165,2022 999 | Mexico,Latin America and Caribbean,46,6.128,2022 1000 | Croatia,Central and Eastern Europe,47,6.125,2022 1001 | Poland,Central and Eastern Europe,48,6.123,2022 1002 | El Salvador,Latin America and Caribbean,49,6.12,2022 1003 | Kuwait,Middle East and Northern Africa,50,6.106,2022 1004 | Hungary,Central and Eastern Europe,51,6.086,2022 1005 | Mauritius,Sub-Saharan Africa,52,6.071,2022 1006 | Uzbekistan,Central and Eastern Europe,53,6.063,2022 1007 | Japan,Eastern Asia,54,6.039,2022 1008 | Honduras,Latin America and Caribbean,55,6.022,2022 1009 | Portugal,Western Europe,56,6.016,2022 1010 | Argentina,Latin America and Caribbean,57,5.967,2022 1011 | Greece,Western Europe,58,5.948,2022 1012 | South Korea,Eastern Asia,59,5.935,2022 1013 | Philippines,Southeastern Asia,60,5.904,2022 1014 | Thailand,Southeastern Asia,61,5.891,2022 1015 | Moldova,Central and Eastern Europe,62,5.857,2022 1016 | Jamaica,Latin America and Caribbean,63,5.85,2022 1017 | Kyrgyzstan,Central and Eastern Europe,64,5.828,2022 1018 | Belarus,Central and Eastern Europe,65,5.821,2022 1019 | Colombia,Latin America and Caribbean,66,5.781,2022 1020 | Bosnia and Herzegovina,Central and Eastern Europe,67,5.768,2022 1021 | Mongolia,Eastern Asia,68,5.761,2022 1022 | Dominican Republic,Latin America and Caribbean,69,5.737,2022 1023 | Malaysia,Southeastern Asia,70,5.711,2022 1024 | Bolivia,Latin America and Caribbean,71,5.6,2022 1025 | China,Eastern Asia,72,5.585,2022 1026 | Paraguay,Latin America and Caribbean,73,5.578,2022 1027 | Peru,Latin America and Caribbean,74,5.559,2022 1028 | Montenegro,Central and Eastern Europe,75,5.547,2022 1029 | Ecuador,Latin America and Caribbean,76,5.533,2022 1030 | Vietnam,Southeastern Asia,77,5.485,2022 1031 | Turkmenistan,Central and Eastern Europe,78,5.474,2022 1032 | North Cyprus,Western Europe,79,5.467,2022 1033 | Russia,Central and Eastern Europe,80,5.459,2022 1034 | Armenia,Central and Eastern Europe,82,5.399,2022 1035 | Nepal,Southern Asia,83,5.377,2022 1036 | Tajikistan,Central and Eastern Europe,84,5.377,2022 1037 | Bulgaria,Central and Eastern Europe,85,5.371,2022 1038 | Libya,Middle East and Northern Africa,86,5.33,2022 1039 | Indonesia,Southeastern Asia,87,5.24,2022 1040 | Ivory Coast,Sub-Saharan Africa,88,5.235,2022 1041 | Albania,Central and Eastern Europe,90,5.199,2022 1042 | South Africa,Sub-Saharan Africa,91,5.194,2022 1043 | Azerbaijan,Central and Eastern Europe,92,5.173,2022 1044 | Bangladesh,Southern Asia,94,5.155,2022 1045 | Algeria,Middle East and Northern Africa,96,5.122,2022 1046 | Liberia,Sub-Saharan Africa,97,5.122,2022 1047 | Ukraine,Central and Eastern Europe,98,5.084,2022 1048 | Morocco,Middle East and Northern Africa,100,5.06,2022 1049 | Cameroon,Sub-Saharan Africa,101,5.048,2022 1050 | Senegal,Sub-Saharan Africa,103,5.046,2022 1051 | Niger,Sub-Saharan Africa,104,5.003,2022 1052 | Georgia,Central and Eastern Europe,105,4.973,2022 1053 | Gabon,Sub-Saharan Africa,106,4.958,2022 1054 | Iraq,Middle East and Northern Africa,107,4.941,2022 1055 | Venezuela,Latin America and Caribbean,108,4.925,2022 1056 | Guinea,Sub-Saharan Africa,109,4.891,2022 1057 | Iran,Middle East and Northern Africa,110,4.888,2022 1058 | Ghana,Sub-Saharan Africa,111,4.872,2022 1059 | Turkey,Middle East and Northern Africa,112,4.744,2022 1060 | Burkina Faso,Sub-Saharan Africa,113,4.67,2022 1061 | Cambodia,Southeastern Asia,114,4.64,2022 1062 | Benin,Sub-Saharan Africa,115,4.623,2022 1063 | Uganda,Sub-Saharan Africa,117,4.603,2022 1064 | Nigeria,Sub-Saharan Africa,118,4.552,2022 1065 | Kenya,Sub-Saharan Africa,119,4.543,2022 1066 | Pakistan,Southern Asia,120,4.516,2022 1067 | Tunisia,Middle East and Northern Africa,121,4.516,2022 1068 | Palestinian Territories,Middle East and Northern Africa,122,4.483,2022 1069 | Mali,Sub-Saharan Africa,123,4.479,2022 1070 | Myanmar,Southeastern Asia,126,4.394,2022 1071 | Sri Lanka,Southern Asia,127,4.362,2022 1072 | Madagascar,Sub-Saharan Africa,128,4.339,2022 1073 | Egypt,Middle East and Northern Africa,129,4.288,2022 1074 | Chad,Sub-Saharan Africa,130,4.251,2022 1075 | Ethiopia,Sub-Saharan Africa,131,4.241,2022 1076 | Yemen,Middle East and Northern Africa,132,4.197,2022 1077 | Mauritania,Sub-Saharan Africa,133,4.153,2022 1078 | Jordan,Middle East and Northern Africa,134,4.152,2022 1079 | Togo,Sub-Saharan Africa,135,4.112,2022 1080 | India,Southern Asia,136,3.777,2022 1081 | Zambia,Sub-Saharan Africa,137,3.76,2022 1082 | Malawi,Sub-Saharan Africa,138,3.75,2022 1083 | Tanzania,Sub-Saharan Africa,139,3.702,2022 1084 | Sierra Leone,Sub-Saharan Africa,140,3.574,2022 1085 | Botswana,Sub-Saharan Africa,142,3.471,2022 1086 | Rwanda,Sub-Saharan Africa,143,3.268,2022 1087 | Zimbabwe,Sub-Saharan Africa,144,2.995,2022 1088 | Lebanon,Middle East and Northern Africa,145,2.955,2022 1089 | Afghanistan,Southern Asia,146,2.404,2022 1090 | --------------------------------------------------------------------------------