I think you need create DataFrame with all 4 masks, then count True
s by sum
and last plot:
m1 = df["Subject"].str.count("w+") >= 3
m2 = df["Mark"].str.count("3") >= 1
df1 = pd.concat([m1, m2, m1 & m2, ~m1 & ~m2], axis=1, keys=('a','b','c','d'))
out = df1.sum()
If need seaborn solution:
import seaborn as sns
ax = sns.barplot(x="index", y="val", data=out.reset_index(name='val'))
For pandas (matplotlib) solution:
out.plot.bar()
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…