Question: write a python function that replaces the None values with the average from that column. example: def replace_with _mean(datalist): ........ returm [] replace_with _mean([['a', 'b'],

write a python function that replaces the None values with the average from that column.

example:

def replace_with _mean(datalist):

........

returm []

replace_with _mean([['a', 'b'], [1, -2], [-3, 4], [None, 6], [7, 8]])

output:

[1.6666666666666667, 4.0]

replace_with _mean([['e', 'f', 'g'], [None, 2, 3], [None, -4, -2], [None, 8, 9]])

output:

[None, 2.0, 3.333333333333333]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!