Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
A sensor wrote the readings 9.8, 9.7, -999 and 9.9. The value -999 is the code of the sensor for "no reading". Put the readings in a table, look at describe(), and show how it reveals the problem. Then turn -999 into a missing value with replace(-999, np.nan), and find the correct mean.
Have you tried it?
Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.
Plan. A summary table often shows a mistake in the data. Look at the minimum and the mean.
Check. describe shows the minimum and a mean of , which is impossible for readings near 10. The spread (504) is huge too. After the replacement, one value is missing, and the mean of the other three is .
Answer: the minimum of and the mean of show the problem. The correct mean is 9.8.
Log in to join the discussion.
Loading…