I am trying to read a value from excel sheet against a string that I pass in python.
for example:
Sample.xlsx sheet has the following table:
| George | 29 | Farmer |
| Frank | 52 | Engineer |
I want to read the value from a given column of my choice when I pass a value in the "Name" column
For example I want my variable in python to be assigned value 29 when I pass Name "George" as string and column 2. For column 3 it should get "Farmer".
I only got as far as reading the table from my excel sheet.
import panda as pd
df = pd.read_excel("Sample.xlsx")
Basically this is vlookup operation, in excel:
value = vlookup("George", A2:C3,2,FALSE)
value is 29 here
value = vlookup("George", A2:C3,3,FALSE)
value is Farmer here
Trying to do this in python.