How to optimize data generation for numpy call
|Added at||2017-01-01 20:01|
I'd like to know how to make the following code shorter and/or more efficient. Could I (or should I) get rid of the for loop by using a functional method, or is there method I should be using from numpy?
The code calculates the expected value of an array of of integers.
As requested in comments, the implementation of the method prob():