📖 INDEX
LOADING ENGINE...
Series.str.replace()
AI & DATA SCIENCE // series-str-replace
Replace each occurrence of pattern/regex in the Series/Index.
Syntax
df['name'] = df['name'].str.replace('old', 'new')Examples
Example 01Basic Usage
df['name'] = df['name'].str.replace('old', 'new')Best Practices
- Use vectorized operations over iterations (e.g.
iterrows()) for performance. - Always verify memory usage when loading large files.