breaks = np.asarray(np.percentile(df.MAT, [25, 50, 75, 100]))
df['Class'] = (df.MAT.values > breaks[..., (np.newaxis)]).sum(0)
ax = df.boxplot(column='N0_YLDF', by='Class')
ax.xaxis.set_ticklabels([('%s' % val) for val in breaks])
Boxplot, стратифицированный по столбцу в python pandas