A Dashboard Project - Section 1

Practice Assignment Overview

Samet Girgin
PursuitOfData
4 min readSep 22, 2023

--

This visualization project is divided into two sections. Section 1 will give you the opportunity to demonstrate your plotting and visualization skills and Section 2 is about creating and customizing dashboards.

  • Part 1 : Analyzing the wildfire activities in Australia
  • Part 2 : Dashboard to display charts based on selected Region and Year

Data Description

This wildfire dataset contains data on fire activities in Australia starting from 2005. Additional information can be found here.
Let’s find out the dataset by its columns:

  • Region: the 7 regions
  • Date: in UTC and provide the data for 24 hours ahead
  • Estimated_fire_area: daily sum of estimated fire area for presumed vegetation fires with a confidence > 75% for a each region in km2
  • Mean_estimated_fire_brightness: daily mean (by flagged fire pixels(=count)) of estimated fire brightness for presumed vegetation fires with a confidence level > 75% in Kelvin
  • Mean_estimated_fire_radiative_power: daily mean of estimated radiative power for presumed vegetation fires with a confidence level > 75% for a given region in megawatts
  • Mean_confidence: daily mean of confidence for presumed vegetation fires with a confidence level > 75%
  • Std_confidence: standard deviation of estimated fire radiative power in megawatts
  • Var_confidence: Variance of estimated fire radiative power in megawatts
  • Count: daily numbers of pixels for presumed vegetation fires with a confidence level of larger than 75% for a given region
  • Replaced: Indicates with an Y whether the data has been replaced with standard quality data when they are available (usually with a 2–3 month lag). Replaced data has a slightly higher quality in terms of locations

Section 1 : Analyzing the wildfire activities in Australia

In this lab we will create visualizations using Matplotlib, Seaborn, Pandas and Folium.

Steps to be performed

Step 1.1: To understand the change in average estimated fire area over time using pandas to plot the line chart.

plt.figure(figsize=(10,5))
df_new = df.groupby("Year")["Estimated_fire_area"].mean()
df_new.plot(x=df_new.index, y=df_new.values)
plt.xlabel("Year")
plt.ylabel("Average Estaimated Fire Area (km2)")
plt.title("Estimated Fire rea over Time")
plt.show()

Step 1.2 To plot the estimated fire area over month

plt.figure(figsize=(10,5))
df_new = df.groupby(["Year","Month"])["Estimated_fire_area"].mean()
df_new.plot(x=df_new.index, y=df_new.values)
plt.xlabel("Year")
plt.ylabel("Average Estaimated Fire Area (km2)")
plt.title("Estimated Fire rea over Time")
plt.show()

Step 1.3 Use the functionality of seaborn to develop a barplot, to find the insights on the distribution of mean estimated fire brightness across the regions

plt.figure(figsize=(8,4))
sns.barplot(data = df, x= "Region", y="Mean_estimated_fire_brightness")
plt.xlabel("Region")
plt.ylabel("Mean Estimated Fire Brightnes (Kelvin)")
plt.title("Distirbution of Mean Estimated Fire Brightness across the Regions")
plt.show()

Step 1.4 Develop a pie chart and find the portion of count of pixels for presumed vegetation fires vary across regions

plt.figure(figsize=(8,4))
region_share = df.groupby("Region")["Count"].sum()
plt.pie(region_share, labels=region_share.index, autopct="%1.1f%%")
plt.title("Distirbution of Mean Estimated Fire Brightness across the Regions")
plt.axis("equal")
plt.show()

Step 1.5 Customize the previous pie plot for a better visual representation

plt.figure(figsize=(8,4))
region_share = df.groupby("Region")["Count"].sum()
plt.pie(region_share, labels=region_share.index)
plt.title("Distirbution of Mean Estimated Fire Brightness across the Regions")
plt.legend([(i,round(k/region_share.sum()*100,2)) for i,k in zip(region_share.index, region_share)])
plt.axis("equal")
plt.show()

Step 1.6 Use Matplotlib to develop a histogram of the mean estimated fire brightness

plt.figure(figsize=(10, 6))
plt.hist(x=df['Mean_estimated_fire_brightness'], bins=20)
plt.xlabel('Mean Estimated Fire Brightness (Kelvin)')
plt.ylabel('Count')
plt.title('Histogram of Mean Estimated Fire Brightness')
plt.show()

Step 1.7 Use the functionality of seaborn and pass region as hue, to understand the distribution of estimated fire brightness across regions

sns.histplot(data=df, x="Mean_estimated_fire_brightness", hue="Region")
plt.show()


vs

sns.histplot(data=df, x="Mean_estimated_fire_brightness", hue="Region", multiple="stack")
plt.show()

Step 1.8 Develop a scatter plot to find the correlation between mean estimated fire radiative power and mean confidence level

plt.figure(figsize=(10, 6))
sns.scatterplot(data=df, x="Mean_confidence", y='Mean_estimated_fire_radiative_power')
plt.xlabel('Mean Estimated Fire Radiactive Power (Mw)')
plt.ylabel('Mean Confidence')
plt.title('Mean Estimated Fire Radiactive Power vs Mean Confidence')
plt.show()

Step 1.9 Mark all seven regions affected by wildfires, on the Map of Australia using Folium

#For australia use [-25, 135] as location to create the map
region_data = {'region':['NSW','QL','SA','TA','VI','WA','NT'], 'Lat':[-31.8759835,-22.1646782,-30.5343665,-42.035067,-36.5986096,-25.2303005,-19.491411],
'Lon':[147.2869493,144.5844903,135.6301212,146.6366887,144.6780052,121.0187246,132.550964]}
reg=pd.DataFrame(region_data)
reg
# create a feature group 
aust_reg = folium.map.FeatureGroup()

# Create a Folium map centered on Australia (Create a Map with Folium and Leaflet.js)
Aust_map = folium.Map(location=[-25, 135], zoom_start=4)

# loop through the region and add to feature group
for lat, lng, lab in zip(reg.Lat, reg.Lon, reg.region):
aust_reg.add_child(
folium.features.CircleMarker(
[lat, lng],
popup=lab,
radius=5, # define how big you want the circle markers to be
color='red',
fill=True,
fill_color='blue',
fill_opacity=0.6
)
)

# add incidents to map
Aust_map.add_child(aust_reg)

Reference:

https://github.com/sametgirgin/DataVisualisation/blob/main/Practice_Assignment_Section1.jupyterlite.ipynb

--

--

Samet Girgin
PursuitOfData

Data Analyst, Petroleum & Natural Gas Engineer, PMP®