I have a simple pandas DataFrame containing a list of European country names with a score value for each country. I want to display a map of Europe in a Jupyter notebook with each country colored according to that score. I want this map to be a simple, rendered image (not something dependent on, like, Google Maps). How could this be done?
import pandas as pd
df = pd.DataFrame(
[
["Norway" , 7.537],
["Denmark" , 7.522],
["Switzerland", 7.494],
["Finland" , 7.469],
["Netherlands", 7.377],
],
columns = [
"country",
"score"
]
)
I have searched for tools to do this but it is harder to find something robust than I would have expected. The nearest I have found is Vincent, but it appears to be unsupported now. It can be used in a way like the following:
import vincent
vincent.core.initialize_notebook()
geographic_data = [{
"name": "states",
"url": "https://raw.githubusercontent.com/wrobstory/vincent_map_data/master/us_states.topo.json",
"feature": "us_states.geo"
}]
vis = vincent.Map(
geo_data = geographic_data,
scale = 1000,
projection = "albersUsa"
)
vis.display()
What would be a good way to do this?