Exercise: Dash Graph Components
Explore how to create Dash applications featuring bar plots for average daily rates by department and education field. Learn to build interactive plots that switch between box plots and ECDFs based on dropdown input, using callback functions and Bootstrap styling for enhanced visuals.
We'll cover the following...
Exercise 1
Create a Dash app that has an HTML header 1 component as well as a subplot with a single row and two columns. In row 1, column 1, create a bar plot that looks at the average daily rate of employees for each department. For row 1, column 2, create a bar plot with the average daily rate of employees for each field of education (EducationField) in the dataset. Use the BOOTSTRAP external stylesheet to make the app more visually appealing than the default settings.
Solution
-
The below code defines a function
get_avg_daily_rate()on line 1 that takes a pandas DataFrame and a column ...