Let's say I have a 2d numpy array A:
A = [[0.3, 0.2],
[1.0, 0.1],
[0.3, 0.1],
[1.0, 0.1]]
What I would like is something that maps rows of A to their empirical distribution:
f([0.3, 0.2]) = 0.25
f([1.0, 0.1]) = 0.50
f([-12, 140]) = 0.00
Is there a nice way to do this?
f?