Pandas program to find sum of each column with lowest mean

Write a pandas program to find sum of each column with lowest mean with Practical Example

Program Description

This program calculate the values of each column and find the lowest mean value from DataFrame

Program Logic

  • Create Dictionary say ‘marks’ which contains marks of 5 subjects
  • Create DataFrame say ‘result’ using DataFrame method and print DataFrame.
  • Apply sum function on DataFrame ‘result’ and set value of axis to zero to display column wise sum of dataframe.
  • Apply mean function on DataFrame ‘result’ and set value of axis parameter to zero to calculate column wise mean(average) from values of dataframe ‘result’ .
  • Apply mean function on DataFrame ‘result’ and set value of axis parameter to zero to calculate average from set of values and also apply idxmin function to get index of minimum value in column.
  • Display column wise sum ,mean and column name having minimum average value from dataframe ‘result’
  • Exit

Below is implementation code/Source code

Output:

<