What we can help you with
Read the traceback, shrink the input to a case you can reproduce, and isolate whether the problem comes from the data, the function, or the notebook state.
Why is an average using the wrong denominator?
Consider readings [8, None, 4]. If the task says to ignore missing readings, the total is 12 and the count is 2. Dividing by the original list length gives 4 instead of 6. Test a fully populated list, a list with missing values, and an all-missing list. Check the assignment before deciding how to handle the last case.
What to bring
Send the full traceback, your Python version or notebook environment, the expected result, and the smallest safe input that reproduces the issue.
We work through the reasoning and give feedback. You write and submit your own work.