datframe.loc code example
Example 1: df.loc a list of index
df[df.index.isin([1,3])]
Example 2: dataframe loc change values
%timeit df.at['Bill', 'language'] = 'Python'
df[df.index.isin([1,3])]
%timeit df.at['Bill', 'language'] = 'Python'