import os
import os.path
import pandas as pd
datadir = "publicdata"
path = os.path.join(datadir, "topnames.csv")
topnames0 = pd.read_csv(path)
topnames = topnames0.set_index(['year', 'sex'])
names0 = topnames0.head(10)
names = topnames.head(10)
path = os.path.join(datadir, "indicators2016.csv")
ind0 = pd.read_csv(path)
ind = ind0.set_index('code')
large_country = ind['pop'] > 1000
large_country
ind[large_country]
ind[ind['pop'] > 1000]
ind['life'] > 77
(ind['pop'] > 1000) | (ind['life'] > 77)
What happens if we omit the parenthesis? Why?
nlargest
nsmallest
sort_index
sort_values