Python Pandas agg error
Because there is no more column "NOX" 

you changed it in the previous mean aggregation. Try "avg_Nox" or whatever column  name you get after applying your first aggregation function


bh_df.groupby('CAT.MEDV').agg(
  avg_Nox=('NOX', 'mean'))