I’m trying to import an excel file and search for a specific record
Here’s what I have come up with so far, which keeps throwing error.
The excel spread sheet has two columns Keyword and Description, each keyword is around 10 characters max, and description is around 150 characters max.
I can print the whole sheet in the excel file without any errors using print(df1) but as soon as I try to search for a specific value it errors out.
Error
ValueError: ('Lengths must match to compare', (33,), (1,))
Code
import pandas as pd
file = 'Methods.xlsx'
df = pd.ExcelFile(file)
df1 = df.parse('Keywords')
lookup = df1['Description'].where(df1['Keyword']==["as"])
print (lookup)