how to remove spacer vrom rows df code example
Example 1: replace all spacec column with underscore in pandas
import pandas as pd
# remove spaces in columns name
df.columns = df.columns.str.replace(' ','_')
Example 2: python - remove exta space in column
df.Name = df.Column_Name.replace('\s+', ' ', regex=True)