Reputation:
I'm following this guide in starting with gmaps api and python;
import gmaps
import gmaps.datasets
import pandas as pd
def func():
# Use google maps api
gmaps.configure(api_key='MY_API_KEY') # Fill in with your API key
# Get the dataset
earthquake_df = gmaps.datasets.load_dataset_as_df('earthquakes')
# Get the locations from the data set
locations = earthquake_df[['latitude', 'longitude']]
# Get the magnitude from the data
weights = earthquake_df['magnitude']
# Set up your map
fig = gmaps.figure()
fig.add_layer(gmaps.heatmap_layer(locations, weights=weights))
return fig
func()
been using this code from the guide (both on pychram and jupyter notebooks) but when i run the code (pychram/jupyter/terminal) I don't get the output map like in the guide. just a nice old-fashion
Process finished with exit code 0
Upvotes: 0
Views: 2639
Reputation: 63
Check if it is enabled for jupyter first by running jupyter nbextension list
.
If you do not see jupyter-gmaps/extension enabled
then you need to run this line in terminal jupyter nbextension enable --py gmaps
and then run a new jupyter notebook.
Upvotes: 1