Medium
Fill With the Median
Fill the missing values of every number column with that column's median. Then print each number column's mean with 2 decimal places as
column: mean, in column order. Leave text columns alone.Input
A CSV table: a header line, then one line per row (an empty field means a missing value), then a line END.
Output
One line per number column.
Sample 1
Input
dept,hours,score CSE,12,85 EEE,5,52 CSE,,78 BBA,2,31 EEE,7, END
Output
hours: 6.40 score: 62.20
Sample 2
Input
a,b 1,100 ,200 3, 100,400 END
Output
a: 26.75 b: 225.00
Output appears hereHints