[Desired output](https://i.stack.imgur.com/k2D3l.png)
Some how I am not able to succeed on executing the line below:

Could anyone help me in checking the error:

extracting maximum Avail Ener landings per Airport
==================================================

```
    df1=df.loc[df.reset_index().groupby(['Airport'])['Avail Emer Landings'].idxmax()]
    print(df1)

```

Total code here:

from random import randint
import pandas as pd
class City:
def **init**(self, X, Y):  

self.X=X
self.Y=Y

```
def Avial_Emer_Landings(self):
    df= pd.DataFrame(columns=['Airport','Airline','Avail Emer Landings'])
    for i in range(0, len(self.X)):
        for j in range(0, len(self.Y)):
            a= randint(0,5)
            tmp_dict = {'Airport' : self.X[i] , 'Airline' : self.Y[j],'Avail Emer Landings' : a}
            df = df.append(tmp_dict,ignore_index=True)
    print(df)

    # extarcting maximum Avail Ener landings per Airport

    df1=df.loc[df.reset_index().groupby(['Airport'])['Avail Emer Landings'].idxmax()]
    print(df1)

```

Airport = ['A1','A2','A3','A4','A5']  

Airline = ['Indigo','AirFrance','AirIndia','Lufhtansa','British Airways']

b=City(Airport,Airline)
b.Avial\_Emer\_Landings()