import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
data = pd.read_csv("kumpula.csv",dayfirst=True,sep=",",
header=0,decimal=b".",index_col=0,
parse_dates= { 'date': [0, 1, 2, 3]},usecols=[0,1,2,3,5])
data['avg'] = data.radiation.rolling( 250).mean()
data1 = pd.read_csv("tahtela.csv",dayfirst=True,sep=",",
header=0,decimal=b".",index_col=0,
parse_dates= { 'date': [0, 1, 2, 3]},usecols=[0,1,2,3,5])
data1['avg'] = data1.radiation.rolling( 250).mean()
plt.figure(figsize=(16,6))
sns.lineplot(x = 'date',
y = 'avg',
data = data,
label = 'Kumpula')
sns.lineplot(x = 'date',
y = 'avg',
data = data1,
label = 'Tähtelä')
plt.title("Moving average of direct solar radiation in the year 2021")
plt.ylabel("W/m2") # Start writing code here...
data = pd.read_csv("kumpula_temp.csv",dayfirst=True,sep=",",
header=0,decimal=b".",index_col=0,
parse_dates= { 'date': [0, 1, 2, 3]},usecols=[0,1,2,3,5])
data['avg'] = data.temperature.rolling( 5).mean()
data1 = pd.read_csv("tahtela_temp.csv",dayfirst=True,sep=",",
header=0,decimal=b".",index_col=0,
parse_dates= { 'date': [0, 1, 2, 3]},usecols=[0,1,2,3,5])
data1['avg'] = data1.temperature.rolling( 5).mean()
plt.figure(figsize=(16,6))
sns.lineplot(x = 'date',
y = 'avg',
data = data,
label = 'Kumpula')
sns.lineplot(x = 'date',
y = 'avg',
data = data1,
label = 'Tähtelä')
plt.title("Moving average of air temperature in the year 2021")
plt.ylabel("°C")