Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Weather Data Analysis Using Python

Project Overview

This project analyzes global weather data using Python to explore patterns in temperature, humidity, and precipitation across different countries and locations.

The project demonstrates an end-to-end exploratory data analysis workflow, including data preparation, data cleaning, descriptive statistical analysis, monthly weather analysis, data visualization, extreme weather analysis, and insight generation.

Objectives

  • Clean and prepare the weather dataset for analysis.
  • Analyze temperature, humidity, and precipitation patterns.
  • Perform descriptive statistical analysis.
  • Examine monthly weather trends.
  • Visualize important weather patterns.
  • Identify extreme temperature and precipitation observations.
  • Generate meaningful insights from the analyzed data.

Tools & Technologies

  • Python
  • Pandas
  • NumPy
  • Matplotlib
  • Google Colab
  • Jupyter Notebook

Dataset

This project uses the Global Weather Repository dataset, which contains weather observations from different countries and locations.

The analysis focuses on the following variables:

  • last_updated — Date and time of the weather observation
  • temperature_celsius — Temperature measured in Celsius
  • humidity — Relative humidity percentage
  • precipitation_mm — Precipitation measured in millimeters
  • country — Country associated with the weather observation
  • location_name — Name of the location or city

Dataset Availability

The original dataset file, GlobalWeatherRepository.csv, is not included in this GitHub repository because its file size exceeds GitHub's browser upload limit.

To run the analysis, obtain the Global Weather Repository dataset and save or upload it using the filename:

GlobalWeatherRepository.csv

The Jupyter Notebook contains the complete data cleaning, analysis, and visualization workflow performed on the dataset.

Data Analysis Process

1. Data Loading

The weather dataset was imported into Google Colab and loaded into a Pandas DataFrame for analysis.

2. Dataset Understanding

The structure of the dataset was examined by checking:

  • Dataset dimensions
  • Column names
  • Data types
  • Sample records

This provided an initial understanding of the available weather information.

3. Feature Selection

The variables relevant to the analysis were selected from the original dataset.

The selected features include:

  • Date and time
  • Temperature
  • Humidity
  • Precipitation
  • Country
  • Location

4. Data Cleaning and Data Quality Checks

The selected dataset was checked for:

  • Missing values
  • Duplicate records
  • Incorrect data types
  • Invalid date values

The last_updated column was converted to datetime format to support time-based analysis.

Duplicate records were removed before performing the analysis.

5. Descriptive Statistical Analysis

Descriptive statistics were calculated for the major weather variables.

The following statistical measures were analyzed:

  • Mean
  • Median
  • Standard Deviation

These measures were calculated for:

  • Temperature
  • Humidity
  • Precipitation

The analysis provides an understanding of the typical values and variability of the weather observations.

6. Monthly Weather Analysis

Month information was extracted from the last_updated column.

The data was grouped by month to calculate average:

  • Temperature
  • Humidity
  • Precipitation

The monthly results were arranged chronologically from January to December to make weather patterns easier to analyze.

7. Data Visualization

Matplotlib was used to visualize important patterns identified during the analysis.

The following visualizations were created:

  • Average Monthly Temperature Line Chart
  • Average Monthly Precipitation Bar Chart
  • Temperature Distribution Histogram

These visualizations make it easier to understand monthly variations and the overall distribution of temperature observations.

8. Extreme Weather Analysis

Extreme weather observations were identified by analyzing:

  • Highest recorded temperature
  • Lowest recorded temperature
  • Highest recorded precipitation

The corresponding country, location, and date associated with each extreme observation were also examined.

Key Insights

  • Temperature shows noticeable variation across different months.
  • Monthly analysis helps identify warmer and cooler periods within the dataset.
  • Humidity remains relatively high across many weather observations.
  • Many observations record little or no precipitation.
  • Temperature distribution shows considerable variation across the different geographic locations included in the dataset.
  • Extreme temperature and precipitation observations highlight the importance of examining unusual values during exploratory data analysis.
  • Extremely high or low observations may require additional validation before drawing conclusions because they could represent exceptional conditions or potential data-quality issues.

Conclusion

This project demonstrates an end-to-end exploratory data analysis workflow using Python.

The analysis covers data loading, dataset understanding, feature selection, data cleaning, descriptive statistical analysis, monthly weather analysis, data visualization, extreme-value analysis, and insight generation.

The project demonstrates practical application of Pandas, NumPy, and Matplotlib for transforming raw weather data into meaningful and understandable analytical findings.

It also demonstrates the importance of data-quality assessment and validation when analyzing unusual or extreme observations.

Repository Structure

Weather-Data-Analysis/

  • README.md
  • Weather_Data_Analysis.ipynb

Note: GlobalWeatherRepository.csv is used for the analysis but is not included in this repository because its file size exceeds GitHub's browser upload limit.

How to Run the Project

  1. Download or clone this repository.
  2. Obtain the Global Weather Repository dataset.
  3. Open Weather_Data_Analysis.ipynb in Google Colab or Jupyter Notebook.
  4. Upload the dataset and ensure the filename is GlobalWeatherRepository.csv.
  5. Run the notebook cells sequentially from top to bottom.

Skills Demonstrated

  • Data Cleaning
  • Exploratory Data Analysis (EDA)
  • Data Manipulation
  • Descriptive Statistics
  • Time-Based Analysis
  • Data Visualization
  • Data Quality Assessment
  • Insight Generation
  • Python Programming

Author

Argha Saha

Aspiring Data Analyst

Skills: Python | SQL | Power BI | Excel | Pandas | NumPy | Matplotlib

About

Exploratory analysis of global weather data using Python, Pandas, NumPy, and Matplotlib.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages