python count how many times a string is present in the entire row of a pandas dataframe
I have a question based upon my earlier question . Below code runs fine and it tells me whether the search_string is present in the entire row or not. How could I modify the last line so that it provides me counts of matches instead of 1 or 0? For example, for the first row it should return 4 as my search_string is present in 4 locations in that row. sales = [{'account': 'Jones LLC jones', 'Jan': '150', 'Feb': '200', 'Mar': '140 jones jones'}, {'account': 'Alpha Co', 'Jan': 'Jones', 'Feb': '210', 'Mar': '215'}, {'account': 'Blue Inc', 'Jan': '50', 'Feb': '90', 'Mar': '95' }] df = pd.DataFrame