This is my initial days working with pandas and excel.
I have two problems where I am stuck.
My excel look like this:-
Port | NaN |
---|---|
1 | OPS |
2 | WTH |
3 | PNS |
4 | SSM |
5 | RTY |
6 | EWR |
I have to search for value '4' in Column1(I dont have column name so I may have to use df.iloc[:,0]).
Now, if I find the value '4' then I should output 'SSM'.
1)I am having trouble finding the value '4' not sure which function to use. I checked the type of the return object and got this.
column_port=df.iloc[:,0]
print(type(column_port))
<class 'pandas.core.series.Series'>
I am not sure how to search for a element in this return type.
2)If I found the value '4' , how to output the value from different column. In this case 'SSM'.