write a python function to find the record with highest and lowest marks obtained by student from a file result.csv having field (name , total_marks)
import pandas as pd
df = pd.read_csv('result.csv')
def find_stats():
high = df[(df['total_marks'] == df['total_marks'].max())|(df['total_marks'] == df['total_marks'].min())]
return high
find_stats()
Comments
Leave a comment