text_plain_output_1.png image_output_1.png
import matplotlib.pyplot as plt

import numpy as np

import numpy as np # linear algebra

import pandas as pd

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

df = pd.read_csv('../input/ibutton2016/Temp2016.csv', skiprows=[i for i in range(1, 1096)], skipfooter=1112, engine='python', parse_dates=['Var1'], index_col=['Var1'])
df.index.name = 'Date'
df.index = pd.to_datetime(df.index)
df = df.replace(0, np.nan)

spat_mean = df.mean(axis=1).copy()
print(spat_mean)
spat_mean.groupby(spat_mean.index.hour).mean().plot()
plt.title('Spatial mean: Diurnal cycle of summer 2021 absolute')
plt.ylabel('Temperature ℃')
plt.xlabel('Hour of the day')
plt.show()