I’m having trouble calculating the value of ‘x’ for ex5 using sum as a panda function. I am getting an Index Error: only integers, slices (:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indices

It looks like the value that you are using to access some numpy array (one value inside [ ]) is not integer, slice or ellipsis. You need to check if you are not passing another type, such as another array, or a string.

for this same exercise I’m getting an error as ‘NameError: name ‘x’ is not defined’ even though in the previous cell data class consists this variable. can anyone help?

Hi Priyanka, please let me know whether I’ve correctly diagnosed your problem. The x, n, and pvariables arguments are wrapped inside of the estimation_metrics_pop() function. In other words, the x and n variables cannot be recalled to calculate the p variable, and instead need to be re-calculated once again.