Skip to main content

Posts

Showing posts with the label 5. Write a Pandas program to select the rows the percentage is between 70 and 90 .

ads1

5. Write a Pandas program to select the rows the percentage is between 70 and 90 .

  5. Write a Pandas program to select the rows the percentage is between 70 and 90 . Solution :-  import pandas as pd import numpy as np exam_data = {'name':['abc','xyz','mno','pqr','ghk'],              'perc':[79.25,25,69.90,86,87],              'qualify':['yes','no','yes','yes','yes']} labels = ['A','B','C','D','E'] df = pd.DataFrame(exam_data, index = labels) print("Number of Studemt whoes percentage more than 70 :- ") print(df[df['perc'].between(70,90)]) Output :- 

ads2