Remove rows whose amount is outside [Q1 − 1.5·IQR, Q3 + 1.5·IQR]. Store the remaining rows in result.
import pandas as pd
df = pd.DataFrame({"txn": range(1, 11), "amount": [120, 135, 128, 142, 131, 990, 126, 138, 5, 133]})Store your final answer in a variable named result.
Run your code to see the output here.