使用geohash时,将geohash化的地点字符串编码解码为经纬度,并计算出8个相邻区域的经纬度
df['start_lat_lng'] = df['geohashed_start_loc'].apply(lambda s : geohash.decode(s))
df['end_lat_lng'] = df['geohashed_end_loc'].apply(lambda s : geohash.decode(s))
df['start_neighbors'] = df['geohashed_start_loc'].apply(lambda s : geohash.neighbors(s))
后面还有内容,报错的时候标了这一段
主要标在geohash.neighbors 上
显示为:
AttributeError:module 'geohash' has no attribute 'neighbors'
使用的是jupyter
前面数据库导入是下面这样的
#导入需要的包和库
import pandas as pd
import seaborn as sns
import geohash
import matplotlib.pyplot as plt
from math import radians, cos, sin, asin, sqrt
求问哪里出问题了,要怎么解决