Use DataFrame.loc
with mask and then select for first match value converted values to array and select first one:
df.loc[df['names'] == 'pqr', 'Total'].to_numpy()[0]
#or select first match value by position
df.loc[df['names'] == 'pqr', 'Total'].iat[0]
Or for more general solution working also if no match use:
next(iter(df.loc[df['names'] == 'pqr', 'Total']), 'no match')
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…