Cleaning_columns

PHOTO EMBED

Mon Mar 27 2023 04:47:05 GMT+0000 (Coordinated Universal Time)

Saved by @lmacciomaretto

df.columns = df.columns.str.strip().str.lower().str.replace('', '_')
content_copyCOPY

This snippet cleans up columns when we read them in. Specifically, it iterates over columns, strips white spaces on the outside, lowercases them and replaces all the spaces with underscores.