I have following format of DataFrame:
# import pandas library
import pandas as pd
# Creating a dictionary
d = {'id': ['a', 'b', 'c'],
'label': ['bal', 'sal', 'tal'],
}
# Creating a Dataframe
df = pd.DataFrame(d)
# show the dataframe
print(df)
Output:
id label
0 a bal
1 b sal
2 c tal
I have id = 'b'
. Now I want to access the corresponding label
value like label = 'sal'
.
How can I do this?