Skip to content

Instantly share code, notes, and snippets.

@chankeypathak
Created October 9, 2017 09:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chankeypathak/f2c030a6c4afc9c63e17b3218edb6fa5 to your computer and use it in GitHub Desktop.
Save chankeypathak/f2c030a6c4afc9c63e17b3218edb6fa5 to your computer and use it in GitHub Desktop.
Get top 10 student names
import pandas as pd
df = pd.read_csv(r'data.csv', encoding='utf8')
df['score'] = df['score'].str.replace('%', '')
score_df = (df['score'].sort_values(ascending=False)[:5])
indexes = score_df.index
print (df.iloc[indexes])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment