output_notebook() # Sets up Bokeh to display plots in Jupyter Notebook
bokeh.core.validation.silence(EMPTY_LAYOUT, True)# Suppress certain Bokeh warnings for a cleaner output
bokeh.core.validation.silence(MISSING_RENDERERS, True)# Suppress certain Bokeh warnings for a cleaner output
Grouping the data by administrative region and date, then calculate the mean of the NO2 column number density
Creating a line chart using a custom function get_line_chart
Parameters:
df: DataFrame containing the data
category: Column name for the categorical variable (administrative region in this case)
title: Title for the plot
source: Source of the data (e.g., 'Copernicus')
measure: The measure being plotted (NO2 column number density in this case)
line_chart = get_line_chart(df, category='admin1Name', title='Monthly Air Pollution in Lebanon by Admin 1', source='Copernicus', measure='NO2_column_number_density')
Suggested comments
output_notebook() # Sets up Bokeh to display plots in Jupyter Notebook
bokeh.core.validation.silence(EMPTY_LAYOUT, True)# Suppress certain Bokeh warnings for a cleaner output bokeh.core.validation.silence(MISSING_RENDERERS, True)# Suppress certain Bokeh warnings for a cleaner output
Grouping the data by administrative region and date, then calculate the mean of the NO2 column number density
df = monthly_no2_adm1.groupby(['admin1Name', 'date']).mean('NO2_column_number_density').reset_index()
Creating a line chart using a custom function get_line_chart
Parameters:
df: DataFrame containing the data
category: Column name for the categorical variable (administrative region in this case)
title: Title for the plot
source: Source of the data (e.g., 'Copernicus')
measure: The measure being plotted (NO2 column number density in this case)
line_chart = get_line_chart(df, category='admin1Name', title='Monthly Air Pollution in Lebanon by Admin 1', source='Copernicus', measure='NO2_column_number_density')
Display the line chart
show(line_chart)