【发布时间】:2021-11-22 03:18:33
【问题描述】:
我有三个具有以下形状的 np 数组:
# (176 x 104)
mean_displacement
# (176 x 104 x 15) 15 values for each displacement
displacement_distribution
# (176 x 104 x 15) 15 weights/probability for each displacement
weights
现在我想计算它的CDF,但我遇到了麻烦,因为这是我第一次使用多维数组。必须为每个像素的所有位移计算 CDF。将有 18,304 个像素,CDF 绘图位于此区域内:
(displacement[range(136, 163), :][:, range(0, 18)]) if displacement >= 0.1
这将从图中删除所有位移小于0.1 的单元格。
只需要一些见解,这里是a Google drive link for the three np array files 和下面的示例:
>>> weights
[
[[0.123704][0.092778][0.092778][0.092778]]
[[0.123704][0.092778][0.092778][0.092778]]
[[0.123704][0.123704][0.123704][0.123704]]
...
]
>>> displacement_distribution
[
[[0.1][0.1][0.1][0.1]]
[[0.1][0.1][0.1][0.1]]
...
]
这是CDF 绘图的草图:
【问题讨论】:
-
您能否说明如何针对
mean_displacement、displacement_distribution和weights定义CDF。在一维情况下,它们分别是一个标量和两个 15 元素向量,对吗? -
mean_displacement显示每个单元/像素的平均位移,displacement_distribution:对于每个像素,有 15 个位移值weights:对于每个像素,有 15 个概率/权重与15 个位移值中的每一个 -
imgur.com/a/ZotBUGo">
-
您能提供一些示例数据吗?
-
我在哪里可以将 numpy 数组文件发送给您?