Python 2.7 如何找到在参考点之间具有纬度和经度的所有点?
我想提取所有经度和纬度在我之前定义的值范围内的点。 这些值存储在dataframe中:Python 2.7 如何找到在参考点之间具有纬度和经度的所有点?,python-2.7,pandas,error-handling,dataframe,Python 2.7,Pandas,Error Handling,Dataframe,我想提取所有经度和纬度在我之前定义的值范围内的点。 这些值存储在dataframe中: Latitude = 10 Longitude = 10 Lat_min = Latitude - 0.5 Lat_max = Latitude + 0.5 Lon_min = Longitude - 0.5 Lon_max = Longitude + 0.5 Df_lat_lon = Df[(Df['Latitutedx100'] >= Lat_min) & (Df['Latitutedx1
Latitude = 10
Longitude = 10
Lat_min = Latitude - 0.5
Lat_max = Latitude + 0.5
Lon_min = Longitude - 0.5
Lon_max = Longitude + 0.5
Df_lat_lon = Df[(Df['Latitutedx100'] >= Lat_min) & (Df['Latitutedx100'] <= Lat_max)]
& Df[(Df['Longitudex100'] >= Lon_min) & (Df['Longitudex100'] <= Lon_max)]
我想知道是否有人对“操作码”和“and_bdd”有更多的了解
它们是什么意思?
注意:完成任务的正确方法是:
Df_lat_lon = Df[(Df['Latitutedx100'] >= Lat_min) & (Df['Latitutedx100'] <= Lat_max)
& (Df['Longitudex100'] >= Lon_min) & (Df['Longitudex100'] <= Lon_max)]
Df_lat_lon=Df[(Df['latutedx100']>=lat_min)&(Df['latutedx100']=lon_min)&(Df['Longitudex100']]您可以尝试以下方法:
Df_lat_lon = Df[(Df.Latitutedx100.between(Lat_min, Lat_max)) & (Df.Longitudex100.between(Lon_min, Lon_max))]
你看过例如吗?你能展示一些样本数据吗?
Df_lat_lon = Df[(Df.Latitutedx100.between(Lat_min, Lat_max)) & (Df.Longitudex100.between(Lon_min, Lon_max))]