Python, Pandas, Data Science, Climate Change, Matplotlib.
areas: df_country = df[df.index.get_level_values("area") == area].reset_index() dates = df_country["timestamp"].map(datetime.toordinal) gradient, offset = np.polyfit(dates, df_country.temp_change, deg=1) ax1.scatter(df_country.timestamp, df_country.temp_change, label=area, s=5)