<jupyter_start><jupyter_text>Climate change is real!  The DataWe have gathered average temperature data for countries across the globe, over the last ~350 years.<jupyter_code>import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
temperatures = pd.read_csv("../data/global_temperatures/GlobalLandTemperaturesByCountry.csv", parse_dates=['dt'])
continents = pd.read_csv("../data/continents.csv")
temperatures = temperatures.merge(continents)

recent = temperatures[temperatures.dt > '2000']

temperatures['month'] = temperatures.dt.dt.month_name() # extract month from date
temperatures['m'] = temperatures.dt.dt.month # extract month from date
temperatures['year'] = temperatures.dt.dt.year # extract year from date
pivot = temperatures.pivot_table(index=["m","month"],columns="year",values="AverageTemperature", aggfunc="mean")
temperatures.sample(5)<jupyter_output><empty_output><jupyter_text>First LooksThere are major differences between continents on both average values and the amount of fluxtuation throughout the year. A good start to understanding this would be to treat each month and continent separately.<jupyter_code>recent = temperatures[temperatures.dt > '2010']
g = sns.relplot(data=recent, x='dt', y='AverageTemperature', hue="Continent", kind="line")
g.fig.suptitle("Global Temperatures", fontsize=20);
g.fig.set_figwidth(15)<jupyter_output>c:\users\duranl4\.virtualenvs\visualization-seminar-qrgs2xap\lib\site-packages\pandas\plotting\_matplotlib\converter.py:103: FutureWarning: Using an implicitly registered datetime converter for a matplotlib plotting method. The converter was registered by pandas on import. Future versions of pandas will require you to explicitly register matplotlib converters.

To register the converters:
	>>> from pandas.plotting import register_matplotlib_converters
	>>> register_matplotlib_converters()
  warnings.warn(msg, FutureWarning)<jupyter_text>Removing SeasonalityWe quickly saw that the data was highly seasonal (of course!), so decided to re-frame the visuals to take away this dominant effect. We can see now that across the board, **temperatures are rising**<jupyter_code># Solution
fig, ax = plt.subplots(figsize=(15,5))
sns.heatmap(pivot, ax = ax, cmap="Spectral_r");<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10307017543859649, 'fraction_numerical': 0.010526315789473684, 'mean_word_length': 7.117437722419929, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '286056', 'license': 'MIT', 'n_tokens_mistral': 708, 'n_tokens_neox': 668, 'n_words': 194, 'path': 'Full/Part 3 - Sharing Notebooks/.Global Temperatures are Changing.ipynb', 'repo_name': 'lucasdurand/visualization-seminar', 'size': '2280'}