Skip to main content

Posts

Showing posts with the label 22. Locate the 3 largest values in a data frame.

ads1

22. Locate the 3 largest values in a data frame.

22. Locate the 3 largest values in a data frame. Solution :-   import pandas as pd  data={'Name':['Aman','Rohit','Deepika','Kamal','Deva','Ramesh','Adnan'],  'Sales':[8500,4500,9300,8600,9200,9600,8400]}  sales=pd.DataFrame(data)  # Find  3 Largest Value for  Column print(sales.nlargest(3,['Sales'])) Output :-

ads2