python中的API密钥

2024-04-25 09:01:23 发布

您现在位置:Python中文网/ 问答频道 /正文

再见!在

我试着运行这个程序:

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

但没有显示图像,而是出现以下错误:

^{pr2}$

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


Tags: thekeyimportapidfyouraslibrary