#!pip install numpy
#Import libraries
import pandas as pd #https://pandas.pydata.org/
import matplotlib.pyplot as plt #https://matplotlib.org/
import matplotlib.dates as mdates #https://matplotlib.org/
import numpy as np #http://www.numpy.org/
#from datetime import date #https://docs.python.org/3/library/datetime.html
Importing data from CSV file obtained from the FMI website
AirTemp = pd.read_csv("temp-lpr-lepola-2020-2021.csv",
sep=",",
header=0,
parse_dates= {"date" : ["Year","m","d","Time"]},
index_col=0,
usecols=[0,1,2,3,5])
AirTemp.info();
AirTemp[:25]
Plot #1: Data of one day measurement in Lappeenranta Lepola (13 December 2020)
fig, ax = plt.subplots(figsize=(16, 6))
ax.plot(AirTemp['2020-12-13'], color='tab:orange', label='Air Temperature')
ax.set_xlabel('Time')
ax.set_ylabel('Air Temperature')
ax.set_title('Air Temperature Measurement in Lappeenranta Lepola Station (13 December 2020)')
ax.grid(True)
xfmt = mdates.DateFormatter('%H:%M')
ax.xaxis.set_major_formatter(xfmt)
plt.show()
Plot #2: Data of Week 30 measurement (26 July 2021 - 1 July 2021)
fig, ax = plt.subplots(figsize=(16, 6))
ax.plot(AirTemp['2021-06-26':'2021-07-01'], color='tab:blue', label='Air Temperature')
ax.set_xlabel('Date')
ax.set_ylabel('Air Temperature')
ax.set_title('Week 30 Air Temperature Measurement in Lappeenranta Lepola Station')
ax.grid(True)
Plot #3: Air temperature measurement on March 2021
fig, ax = plt.subplots(figsize=(16, 6))
ax.plot(AirTemp['2021-06-26'], color='tab:green', label='Air Temperature')
ax.set_xlabel('Date')
ax.set_ylabel('Air Temperature')
ax.set_title('Air Temperature Measurement in Lappeenranta Lepola Station On March 2021')
ax.grid(True)
Plot #4: Air Temperature measurement in a year (December 2020 - December 2021)
fig, ax = plt.subplots(figsize=(16, 6))
ax.plot(AirTemp, color='tab:purple', label='Air Temperature')
ax.set_xlabel('Date')
ax.set_ylabel('Air Temperature')
ax.set_title('Air Temperature Measurement in Lappeenranta Lepola Station On March 2021')
ax.grid(True)