python中的API密钥

时间:2018-11-30 12:46:48

标签: python api

美好的一天!

我正在尝试运行该程序:

import pandas as pd
import gmaps #import the gmaps library
import gmaps.datasets #imports the gmaps.datasets library

gmaps.configure(api_key='< API Key >') # Fill in with your API key

earthquake_df = gmaps.datasets.load_dataset_as_df('earthquakes') #equate your raw data to the designated dataset
earthquake_df.head()

locations = earthquake_df[['latitude', 'longitude']] #locate the 
weights = earthquake_df['magnitude']
fig = gmaps.figure()
fig.add_layer(gmaps.heatmap_layer(locations, weights=weights))
fig

但没有显示图像,而是发生了此错误:

Something went wrong authenticating with Google Maps. This may be because you did not pass in an API key, or the key you passed in was incorrect. Check the browser console, look for errors that start with Google Maps API error and compare the message against the Google Maps documentation.

我不知道那是什么意思?请任何人帮助我!谢谢!

0 个答案:

没有答案