-
Notifications
You must be signed in to change notification settings - Fork 0
Pandas cheat sheet
Zakir Syed edited this page Jan 30, 2019
·
20 revisions
df.columns = df.columns.str.replace(r'\s+', '_') #This replaces ' ' with '_' in col names
df.columns is of type index dence can be converted to string and cleaned up in a chained fashion
df.columns = df.columns.str.replace('.', '_').str.replace('(','').replace(')','')
for row in df.itertuples():
print(f"{row.Col_1} : {row.Col_2}")