Professional Documents
Culture Documents
Weather Data Time Series Modelling Delhi-Kaggle Notebook - by Merve Gamze C. - Medium
Weather Data Time Series Modelling Delhi-Kaggle Notebook - by Merve Gamze C. - Medium
| Medium
Search
Listen Share
Weather Forecasting
Explore and run machine learning code with Kaggle Notebooks | Using
data from Daily Climate time series data
www.kaggle.com
This dataset provides data from 1st January 2013 to 24th April 2017 in the city of Delhi,
India. The 4 parameters here are meantemp, humidity, wind_speed, meanpressure.
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import plotly.express as px
data = pd.read_csv("/kaggle/input/daily-climate-time-series-data/DailyDelhiClimate
print(data.head())
https://medium.com/@mervegamzenar/weather-forecasting-delhi-kaggle-notebook-2240f49988ef 1/18
11/12/23, 11:03 PM Weather Data Time Series Modelling Delhi-Kaggle Notebook | by Merve Gamze C. | Medium
print(data.describe())
print(data.info())
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 1462 entries, 0 to 1461
Data columns (total 5 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 date 1462 non-null object
1 meantemp 1462 non-null float64
2 humidity 1462 non-null float64
3 wind_speed 1462 non-null float64
4 meanpressure 1462 non-null float64
dtypes: float64(4), object(1)
memory usage: 57.2+ KB
None
The date column in this dataset is not having a datetime data type. We will change it
when required. Let’s have a look at the mean temperature in Delhi over the years:
https://medium.com/@mervegamzenar/weather-forecasting-delhi-kaggle-notebook-2240f49988ef 2/18
11/12/23, 11:03 PM Weather Data Time Series Modelling Delhi-Kaggle Notebook | by Merve Gamze C. | Medium
Now let’s have a look at the humidity in Delhi over the years:
https://medium.com/@mervegamzenar/weather-forecasting-delhi-kaggle-notebook-2240f49988ef 3/18
11/12/23, 11:03 PM Weather Data Time Series Modelling Delhi-Kaggle Notebook | by Merve Gamze C. | Medium
Now let’s have a look at the wind speed in Delhi over the years:
https://medium.com/@mervegamzenar/weather-forecasting-delhi-kaggle-notebook-2240f49988ef 4/18
11/12/23, 11:03 PM Weather Data Time Series Modelling Delhi-Kaggle Notebook | by Merve Gamze C. | Medium
Till 2015, the wind speed was higher during monsoons (August & September) and
retreating monsoons (December & January). After 2015, there were no anomalies in
wind speed during monsoons. Now let’s have a look at the relationship between
temperature and humidity:
https://medium.com/@mervegamzenar/weather-forecasting-delhi-kaggle-notebook-2240f49988ef 5/18
11/12/23, 11:03 PM Weather Data Time Series Modelling Delhi-Kaggle Notebook | by Merve Gamze C. | Medium
Here’s how we can change the data type and extract year and month data from the date
column:
https://medium.com/@mervegamzenar/weather-forecasting-delhi-kaggle-notebook-2240f49988ef 6/18
11/12/23, 11:03 PM Weather Data Time Series Modelling Delhi-Kaggle Notebook | by Merve Gamze C. | Medium
Now let’s have a look at the temperature change in Delhi over the years:
plt.style.use('fivethirtyeight')
plt.figure(figsize=(15, 10))
plt.title("Temperature Change in Delhi Over the Years")
sns.lineplot(data = data, x='month', y='meantemp', hue='year')
plt.show()
Although 2017 was not the hottest year in the summer, we can see a rise in the average
temperature of Delhi every year.
Now let’s move to the task of weather you can install it on your system by using the
command mentioned below in your command prompt or terminal:
The prophet model accepts time data named as “ds”, and labels as “y”. So let’s convert
the data into this format:
Now below is how we can use the Facebook prophet model for weather forecasting
using Python:
plot_plotly(model, predictions)
Follow
https://medium.com/@mervegamzenar/weather-forecasting-delhi-kaggle-notebook-2240f49988ef 9/18
11/12/23, 11:03 PM Weather Data Time Series Modelling Delhi-Kaggle Notebook | by Merve Gamze C. | Medium
Merve Gamze C.
61
https://medium.com/@mervegamzenar/weather-forecasting-delhi-kaggle-notebook-2240f49988ef 10/18
11/12/23, 11:03 PM Weather Data Time Series Modelling Delhi-Kaggle Notebook | by Merve Gamze C. | Medium
Merve Gamze C.
108
https://medium.com/@mervegamzenar/weather-forecasting-delhi-kaggle-notebook-2240f49988ef 11/18
11/12/23, 11:03 PM Weather Data Time Series Modelling Delhi-Kaggle Notebook | by Merve Gamze C. | Medium
Merve Gamze C.
98 2
Merve Gamze C.
60 1
https://medium.com/@mervegamzenar/weather-forecasting-delhi-kaggle-notebook-2240f49988ef 12/18
11/12/23, 11:03 PM Weather Data Time Series Modelling Delhi-Kaggle Notebook | by Merve Gamze C. | Medium
68
https://medium.com/@mervegamzenar/weather-forecasting-delhi-kaggle-notebook-2240f49988ef 13/18
11/12/23, 11:03 PM Weather Data Time Series Modelling Delhi-Kaggle Notebook | by Merve Gamze C. | Medium
Mirza Waleed
Sentinel-1 Backscatter Profiles for Land-use Using Earth Engine: A Box Plot
Approach
This tutorial guides how we can use cloud computing (GEE) and Sentinel-1 SAR dataset to see the
variation in each LULC class using…
32
Lists
ChatGPT prompts
30 stories · 637 saves
New_Reading_List
174 stories · 190 saves
https://medium.com/@mervegamzenar/weather-forecasting-delhi-kaggle-notebook-2240f49988ef 14/18
11/12/23, 11:03 PM Weather Data Time Series Modelling Delhi-Kaggle Notebook | by Merve Gamze C. | Medium
Leveraging Python for Remote Sensing Data Analysis: A Case Study with
MODIS Dataset
Introduction
https://medium.com/@mervegamzenar/weather-forecasting-delhi-kaggle-notebook-2240f49988ef 15/18
11/12/23, 11:03 PM Weather Data Time Series Modelling Delhi-Kaggle Notebook | by Merve Gamze C. | Medium
Reid Majka
13
https://medium.com/@mervegamzenar/weather-forecasting-delhi-kaggle-notebook-2240f49988ef 16/18
11/12/23, 11:03 PM Weather Data Time Series Modelling Delhi-Kaggle Notebook | by Merve Gamze C. | Medium
daython3
22 1
Automatic Flood Mapping using Sentinel-1 SAR and Otsu Method on Google
Earth Engine: Case Study of…
Flood events, which are one of the most common and destructive natural disasters in the world,
cause great loss of life and property. In…
16 1
https://medium.com/@mervegamzenar/weather-forecasting-delhi-kaggle-notebook-2240f49988ef 17/18
11/12/23, 11:03 PM Weather Data Time Series Modelling Delhi-Kaggle Notebook | by Merve Gamze C. | Medium
https://medium.com/@mervegamzenar/weather-forecasting-delhi-kaggle-notebook-2240f49988ef 18/18