Use df.loc for more efficient lookups

Thanks @Jorge-C!