<human>:  How to replace the white space in a string in a pandas dataframe?
<bot>: Here is some code to replace white spaces in dataframe `df` with '_'

df.replace(' ', '_', regex=True)

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.