I couldn’t get the sample function right because of this line
{moderator edit - solution code removed}
the error is
‘numpy.float64’ object cannot be interpreted as an integer
I appreciate your help!
I couldn’t get the sample function right because of this line
{moderator edit - solution code removed}
the error is
‘numpy.float64’ object cannot be interpreted as an integer
I appreciate your help!
It turns out the problem is that p is a “named” parameter to numpy choice. The problem is you specified y.ravel() as a positional parameter.
Here is the documentation for numpy random choice. What you’ll see is that p is the third named parameter, so specifying it as positional in the way you did causes it to get assigned to the size parameter, which is why that particular error gets thrown.