mel_count=a['Names'].str.contains('Mel').sum() if mel_count>0: print ("There are {m} Mels".format(m=mel_count))