I'm trying to get data from column1 of a .xlsx file, when the data I provide matches the data in column2 and column4. I tried using data[data['column2'] == "aa1"] but not satisfied with the result. For column4 data, I used int(raw_input("get data: ")) but that didn't work either.
Sample excel file:
column1,column2,column3,column4
aa,aa1,lll,21
bb,aa2,ll,22
Required output:
aa #when an input of aa1 and 21 is given.
PS- The data is in the form of a pandas dataframe.
.xslxfile into your python code?excel = pd.ExcelFile(file_name) df = excel.parse("Sheet1")pandasDataFrame. please edit your question to include this.