new_data is a pandas dataframe with 4 columns and:
If I want to get a count of occurrences for an exact matching by column I do this:
new_data[new_data == 'blank'].count()
Output:
A 0
B 0
C 0
D 2654
What if I want a partial match for the string 'bla', would be something like this:
new_data[new_data in 'bla'].count()
But of course that does not work. What is the right way to do it?
new_data.str.contains('bla')?