import pandas as pd
users = [('Ali', 'M', 'Lahore', 20000),
            ('Jhon', 'M', 'Dubai', 25000),
            ('Wick', 'M', 'London', 40000),
            ('Harry', 'M', 'Manchester', 35000),
            ('Snape', 'M', 'Hogwards', 30000),
            ('Hermoine', 'F', 'New York', 20000),
            ('Ayesha', 'F', 'Karachi', 24000),
            ('Julie', 'F', 'Miami', 70000)
            ]
#Create a sample dataframe and setting name as index column
df = pd.DataFrame(users, columns =['Name', 'Sex','City', 'Income'])
df.set_index("Name", inplace = True)

# selecting rows based on condition i.e. Income more than 20000
result = df.loc[df['Income'] > 20000]
    
print('Result:', result)