I’m not sure how much I can share on this, all the return types are numpy.float64s. It appears to be outputting the correct values, I’m not sure what other shape it could have. My lab ID is omklyeujvcpk
You can place a screenshot of the error here, it will help mentors undestanding the issue better!
hi @horatius83
Based on the hints provided before the grade function cell, you require to write a single.code for return function which should not include any global variables and use the below pointers under hint section
I hope you are not using DataFrame as per hint mentions because for the grade function dataframe is being recalled by df.
So use the sum function to dataframe and .isnull() to which apply the second point hint i.e. any() and the set the axis parameter, which according to the third hint point mentions True values equal to 1, to this you need to divide to the length of the dataframe you are calculating fraction rows missing for the columns you are working upon.
Hope this helps!
The return type was wrong. numpy.float64 triggers the wrong shape error, but float does not.
have you used np.sum or sum?
issue is not datatype as per the error log, it is stating wrong shape as far I can understand from your error, you are probably incorrectly implementing the codes. my previous written response mentions on how to write the code with reference to the screenshot of hints from the assignment you are working upon.
Your error mentioning two or more variables have recalled incorrectly
I chained the isnull, any, and sum functions together for the numerator so it should be dataframe.sum. It was returning type numpy.float64. I casted the result to a simple float value and it seemed to work.