×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Python
Posted by: Chelsea Trotter
Added: Apr 5, 2022 5:18 PM
Views: 404
  1. def unify_col_name(df):
  2.     # delete space in column names
  3.     df.columns = [c.replace(' ', '') for c in df.columns]
  4.     # all lower case
  5.     df = df.rename(columns=str.lower)
  6.     # cols = [col for col in df.columns if "unnamed" not in col]
  7.     return df