How to calculate percentile (quantile) for each column in pandas dataframe

Here we calculate 0.9th quantile of each column in our dataframe:

q = 0.9

for column in df:
  qr = df[column].quantile(q)
  print(f"{q*100}% are lower than {qr}")

Here’s a good example to understand quantiles.