Count number of rows when row contains certain text
You can just filter the df with your boolean condition and then call len
:
In [155]:
len(df[df['Status'].str.contains('Planned|Missing')])
Out[155]:
2
Or use the index True
from your value_counts
:
In [158]:
df['Status'].str.contains('Planned|Missing').value_counts()[True]
Out[158]:
2