0% found this document useful (0 votes)
31 views2 pages

Weather Analysis Numpy Project

This project demonstrates the use of NumPy for analyzing temperature data from three cities over 12 months, focusing on calculating averages, standard deviations, and correlations. The analysis includes visualizations of temperature trends, revealing that City B is the hottest and City C the coolest. Overall, the findings indicate strong similarities in climate patterns between City A and City B, showcasing NumPy's capabilities for data analytics.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views2 pages

Weather Analysis Numpy Project

This project demonstrates the use of NumPy for analyzing temperature data from three cities over 12 months, focusing on calculating averages, standard deviations, and correlations. The analysis includes visualizations of temperature trends, revealing that City B is the hottest and City C the coolest. Overall, the findings indicate strong similarities in climate patterns between City A and City B, showcasing NumPy's capabilities for data analytics.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Weather Data Analysis using NumPy

Objective:
The goal of this project is to demonstrate how NumPy can be used for performing mathematical and
statistical analysis. We will analyze temperature data of three cities over 12 months to calculate
averages, standard deviations, and correlations, along with creating basic visualizations.

Sample Dataset (Average Monthly Temperature in °C):


Month City_A City_B City_C
Jan 18 25 10
Feb 20 28 12
Mar 25 32 15
Apr 28 35 20
May 32 37 25
Jun 35 38 28
Jul 34 36 30
Aug 33 35 29
Sep 30 34 27
Oct 28 32 22
Nov 24 30 18
Dec 20 27 12

Steps and Implementation:


1. Import NumPy and Matplotlib libraries.
2. Create arrays for temperature data of each city.
3. Perform array operations such as sum, mean, and max.
4. Calculate statistical parameters like mean, median, and standard deviation.
5. Analyze correlation between different cities.
6. Visualize the temperature trend using Matplotlib line charts.

Python Code Snippet:


import numpy as np import matplotlib.pyplot as plt city_A =
np.array([18,20,25,28,32,35,34,33,30,28,24,20]) city_B =
np.array([25,28,32,35,37,38,36,35,34,32,30,27]) city_C =
np.array([10,12,15,20,25,28,30,29,27,22,18,12]) avg_temp = (city_A + city_B + city_C) / 3
print("Average Temperature:", avg_temp) print("Max Temperature:", np.max(avg_temp))
print("Mean (City A):", np.mean(city_A)) print("Correlation (A,B):", np.corrcoef(city_A, city_B)[0,1])

Visualization:
Matplotlib is used to create line charts comparing monthly temperatures across the three cities. The
trends show seasonal changes where temperatures rise till mid-year and drop afterwards.

Conclusion:
1. All cities show a similar temperature trend throughout the year.
2. City B remains the hottest overall, while City C is the coolest.
3. NumPy provides powerful tools for numerical and statistical analysis.
4. Correlation values indicate a strong similarity between City A and City B climate patterns.
5. NumPy forms the foundation for advanced data analytics and machine learning tasks.

You might also like