xxxxxxxxxx
import pandas as pd
# Sample DataFrame
df = pd.DataFrame({'col1': [1, 2, 3], 'col2': [4, 5, 6], 'col3': [7, 8, 9]})
# Check if any column name contains a specific string
search_string = 'col'
has_string = any(search_string in column_name for column_name in df.columns)
print(has_string)
xxxxxxxxxx
mel_count=a['Names'].str.contains('Mel').sum()
if mel_count>0:
print ("There are {m} Mels".format(m=mel_count))
xxxxxxxxxx
my_series[my_series.str.contains("hello")]
0 hello world
1 hello
dtype: object