datapartnership / lebanon-economic-monitor

Understanding Lebanon's Economy through Alternative Data
https://datapartnership.org/lebanon-economic-monitor/
Mozilla Public License 2.0
0 stars 2 forks source link

Issue on page /notebooks/air-pollution/air-pollution.html #53

Open Jagbakpe opened 3 months ago

Jagbakpe commented 3 months ago

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)

g4brielvs commented 2 months ago

@Jagbakpe Thank you for contributing. Would you consider opening a pull request with your proposed changes? See CONTRIBUTING.