import pandas as pd temp= pd.read_csv("temp.txt", delimiter="\t", skipinitialspace=True, encoding= "utf-8") print(temp["score"].nlargest(5)) # print top 5 values print(temp["score"].smallest(5)) # print bottom 5 values print(temp.loc[((temp['score'] >80) & (temp['score'] <=90)) | ((temp['math'] >=80) & (temp['math'] <90))].nlargest(5)) # print conditioned top 5 values
No comments:
Post a Comment