我想在Ruby脚本中处理此错误
df = pd.DataFrame({'carrier': ['c1','c1','c1','c2','c2','c2','c3','c4','c5','c5'],
'airport': ['a1','a3','a1','a1','a2','a2','a3','a4','a4','a1'],
})
df['unique'] = df.groupby(['airport'])['carrier'].transform('nunique')
df[df['unique'].gt(1)].drop_duplicates().reset_index(drop = True)
carrier airport unique
0 c1 a1 3
1 c1 a3 2
2 c2 a1 3
3 c3 a3 2
4 c4 a4 2
5 c5 a4 2
6 c5 a1 3
。
发生此错误时,我想等待一个小时,但无法弄清楚如何拦截该错误。我也想解决其他一些地理名称错误。我一直在使用救援,但是对于我想做的事情来说,这很粗糙。因此,我想将{"message"=>"the hourly limit of 1000 credits for … has been exceeded. Please throttle your requests or use the commercial service.", "value"=>19} (GeoNames::APIError)
当作字符串。