Please note, this is a STATIC archive of website www.w3resource.com from 19 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.

Notes
Akin to:

In [1]:
import numpy as np
import pandas as pd
In [2]:
df = pd.DataFrame([['1990', 'a', 5, 4, 7, 2], ['1991', 'c', 10, 1, 2, 0], ['1992', 'd', 2, 1, 4, 12], ['1993', 'a', 5, 8, 11, 6]], columns=('Date', 'best', 'a', 'b', 'c', 'd'))
df
Out[2]:
Date best a b c d
0 1990 a 5 4 7 2
1 1991 c 10 1 2 0
2 1992 d 2 1 4 12
3 1993 a 5 8 11 6

Pandas: DataFrame - Lookup.

In [3]:
df['value'] = df.lookup(df.index, df['best'])
df
Out[3]:
Date best a b c d value
0 1990 a 5 4 7 2 5
1 1991 c 10 1 2 0 2
2 1992 d 2 1 4 12 12
3 1993 a 5 8 11 6 5

Pandas: DataFrame - Lookup value.