I have a pandas column with some strings values like:
White bear
Brown Bear
Brown Bear 100 Kg
White bear 200 cm
How to check all the strings if they contain the sequence 'White bear' and replace the entire value (not only the sequence) with a string like 'White_bear'?
df['Species'] = df['Species'].str.replace('White bear', 'White_bear')
did not work right for me because it replaces only the sequence.