This project aims to analyze trends, causes, and impacts of fires in the United States using a dataset obtained from Government's Data site. The analysis includes data cleaning and visualization in Python, querying and extracting insights using PostGreSQL, and creating an interactive dashboard using Power BI.
Name: US Fires Dataset
Source: National -US- Fire- Occuring-Points
Format: CSV
Description: The dataset includes detailed information about fire events such as location, size, cause, and managing agencies.
Tools Used: Python (Pandas, NumPy, Matplotlib, Seaborn)
Steps:
- Load Data: Imported the dataset using
pandas.read_csv(). - Handling Missing Values:
- Replaced or imputed missing data in key columns like
STATCAUSEandOWNERAGENCYand other colomns. - Assigned default values for boolean fields with missing entries.
- Replaced or imputed missing data in key columns like
- Data Type Conversion:
- Converted columns such as
DISCOVERYDATETIMEtodatetimeformat. - Ensured numeric fields like
TOTALACRESandLATDD83were properly formatted.
- Converted columns such as
- Exploratory Data Analysis (EDA):
- Export Cleaned Data:
- Saved the cleaned dataset to a new CSV file for SQL and Power BI integration.
Database: PostgreSQL
Steps:
- Table Creation:
- Created a table named
us_fires_datawith properly defined schema, including primary keys and appropriate data types. - Example:
OBJECTID SERIAL PRIMARY KEY,TOTALACRES DOUBLE PRECISION.
- Created a table named
- Data Import:
- Loaded the cleaned CSV data into the PostgreSQL table using the
COPYcommand.
- Loaded the cleaned CSV data into the PostgreSQL table using the
- Key Queries:
- Advanced Insights:.
- Created temporary views for complex aggregations.
Tools Used: Power BI
Steps:
- Data Connection: Imported cleaned data from the CSV file .
- Slicers: Added slicers for:
STATCAUSEOWNERAGENCYFIREYEAR
- KPIs:
- Total fire events (
Count of OBJECTID). - Total area burned (
Sum of TOTALACRES). - Maximum area burned in a single event.
- Total fire events (
- Charts and Visuals:
- Line chart: Fire trends over years (
Count of OBJECTIDvs.FIREYEAR). - Stacked bar chart: Fires by cause and agency (
Count of OBJECTIDvs.STATCAUSE). - Map visualization: Fire locations using
LATDD83andLONGDD83. - Area chart: Total acres burned over time by cause.
- Line chart: Fire trends over years (
- Interactive Dashboard:
- Organized visuals with an intuitive layout.
- Applied consistent color themes (e.g., blue for severity, green for successful containment).
- Top Cause of Fires: Lightning was identified as the leading cause of fires.
- Year with Most Fires: Fire incidents peaked in the year 2000.
- Size Class Distribution: Fires of size class "A" were most common.
- Install the required libraries:
pip install pandas numpy matplotlib seaborn psycopg2
- Run the Jupyter Notebook in the
notebooks/folder to clean and preprocess the dataset.
- Create a new database and table using the schema defined in
sql_queries.sql. - Load the cleaned data into the table using the
COPYcommand.
- Open the
power_bi.pbixfile in Power BI Desktop. - Refresh the data to connect with the latest cleaned dataset or SQL database.
- Interact with the dashboard to explore trends and insights.
- Trend Analysis: Fires have increased over the years, with significant spikes in certain decades.
- Cause Analysis: Lightning remains the most common cause, while human-related causes are growing.
- Agency Impact: Certain agencies are more effective in managing fires based on fire size and frequency.
Feel free to open issues or submit pull requests to enhance the project. Suggestions for additional features or insights are welcome!




