从 python 中给定变量的纬度/经度点数据创建纬度/经度网格?
我有一个大的数据框,DF,我是从多个散布的,不规则数据的文件中创建的。
DF非常长(8131596),并具有列:日期,纬度,经度,var1,var2。
理想情况下,我想创建一个一定纬度/经度边界框的2D网格/地图,并应用我的DF,以便将任何属于该LAT/LON的数据都包括在内。或者,从我的数据中创建2D LAT / LON网格,然后可以稍后将其剪切(即,最终得到2D“ image” / matrix)。
然后,我将在这些不规则的点之间进行插值,最终以DF中每个变量的数据字段结束。
但是,我对此有点困扰。我认为也许会参与网格,但我似乎找不到任何与此情况有关的问题/帮助。
任何建议都非常感谢!
I have a large dataframe, df, which I have created from multiple files of scattered, irregular data.
The df is very long (8131596) and has the columns: date, latitude, longitude, var1, var2.
I would ideally like to create a 2D grid/map of certain latitude/longitude bounding box, and apply my df so any data that falls within that lat/lon is included. Or, create 2D lat/lon grid from my data and I can cut it later (ie, end up with a 2D 'image' / matrix).
I will then interpolate between these irregular points, ending up with essentially a data field for each of the variables in the df.
However I am a bit stuck with what is the best way to go about this. I think perhaps mesh grid will be involved, but I can't seem to find any previous questions/help that relates this situation.
Any suggestions greatly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是针对var1,您必须重复此var2
This is for var1 you would have to repeat this for var2