Data Analysis with Python Projects - Mean-Variance-Standard Deviation Calculator

Tell us what’s happening:
Describe your issue in detail here.

I made a list, converted it into a 3x3 matrix and calculated the mean as below
mean = [(np.mean(a, axis=0)), (np.mean(a, axis=1)), (np.mean(a))]
When I print mean, the values if they are whole numbers show up as 4. not 4.0 and I’m not sure how to change it.
I am coding on pycharm instead of on jupyter notebook

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36

Challenge: Data Analysis with Python Projects - Mean-Variance-Standard Deviation Calculator

Link to the challenge:

Kinda hard without seeing it in action, but doesn’t np.mean return a numpy array where the test is looking for a list?

Sorry for not providing enough information.
Yes currently it is coming out as an array and I am trying to change it to a list but not exactly sure how in the code above to convert it to a list. I’ve tried
mean = mean.tolist() but returns an error

I believe I used toList(), but not from np.mean(arr, ax), I did mine with arr.mean(ax).toList(). Not sure if that makes a difference.

1 Like