用圆而不是矩形的binning 2D数据 - 来自熊猫DF
我有一个X,Y数据的数据框,需要将其汇成圆圈。即一定尺寸的圆圈和间距以某个点为中心。因此,例如,在此采样/binning之后将遗漏一些数据。怎么可能?
我尝试了np.histogram2d
并创建蒙版/广播。面具太慢了,我似乎无法广播圆圈。仅通过以下答案判断该点是否在圆圈的上述网格之内:将2D数据纳入x,y 中的重叠圆。
如果有一种方法可以将边缘或其他方法输入直方图2D并使边缘循环,请告诉我。干杯
I have a dataframe of x, y data and need to bin it into circles. Ie a grid of circles of certain size and spacing centered on some point. So for example some data would be left out after this sampling/binning. How is this possible?
I have tried np.histogram2d
and creating masks/broadcasting. The mask was too slow, and I don't seem able to broadcast into a circle. Only to tell if the point is within said grid of circles via this answer: Binning 2D data into overlapping circles in x,y.
If there is a way to input edges or something into histogram2d and make the edges circular please let me know. Cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可以做到的唯一方法是将您的观点和网格循环循环:这样:
The only way this can be done is by looping over your points and grid of circles like so: