<jupyter_start><jupyter_text>Below packages were needed to plot the map:!pip install pysal!pip install geopandas<jupyter_code>#!pip install pysal
!pip install geopandas
import geopandas as gpd
# We used the inbuilt GeoPandas datasets to make the world map which contours the countries  
# code source: https://towardsdatascience.com/interactive-geographical-maps-with-geopandas-4586a9d7cc10

world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres'))
world

# dropping rows where continent=Antartica in order to make our map look a bit bigger
world = world.drop([159])
world
world[world["continent"]== "Antarctica"]

trial = pd.merge(world, temp_diff, 
  left_on='name', 
  right_on='Country',
    how="left")

trial.head()
#We need to update England Country name to be consistent across all dataframes
trial[trial["name"]=="United Kingdom"]
demo_map[demo_map["CountryName"]=="United Kingdom"]
temp_diff[temp_diff["Country"]=="United Kingdom"]
temp_diff[temp_diff["Country"]=="England"]

temp_diff['Country'] = temp_diff['Country'].replace({'England':'United Kingdom'})
temp_diff[temp_diff["Country"]=="United Kingdom"]


trial = pd.merge(world, temp_diff, 
  left_on='name', 
  right_on='Country',
    how="left")

trial.head()
# read in example geodataframe using geopandas datasets
#world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres'))

fig, ax = plt.subplots(figsize = (20,20))
world.boundary.plot(edgecolor=u'white', color='lightgray', ax=ax)

list_countries = list(demo_map['CountryName'])

#This assigns one colour to all countries
trial.loc[trial['name'].isin(list_countries)].plot(edgecolor=u'white', color="lightblue", ax=ax)

trial.plot(column = 'TemperatureDifference',
           cmap = 'Oranges',
           ax = ax,
           legend = True, 
          legend_kwds = {'label': "Temperature in Celsius ($^\circ$C)",
                   'orientation': 'vertical',
                   'shrink': 0.35})

    
#ax.legend(loc=2,fontsize=10)
ax.legend()
fig.suptitle('Temperature difference per country'+"\n"+'compared to Russia', y=0.68, x=0.45 , fontsize=24);


plt.savefig('/project/Visualisation_graphs/Map_TempDiff.png')
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1429872495446266, 'fraction_numerical': 0.013205828779599272, 'mean_word_length': 5.386627906976744, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '536223', 'license': 'Apache-2.0', 'n_tokens_mistral': 788, 'n_tokens_neox': 724, 'n_words': 159, 'path': 'Maps.ipynb', 'repo_name': 'NataliaChristofi/FIFA_WorldCup_2018', 'size': '2196'}