So I've gone through all the examples on here of replacing special characters from column names, but I can't seem to get it to work for periods.
What I've tried:
# works to remove spaces
df.select([F.col(c).alias(c.replace(' ', '_')) for c in df.columns])
# doesn't work to remove periods
df.select([F.col(c).alias(c.replace('.', '')) for c in df.columns])
# removes special characters except periods
df.select([F.col(col).alias(re.sub("[^0-9a-zA-Z$]+","",col)) for col in df.columns])
I know how to change the name of a column by referencing that specific column, but this needs to change names of columns for any dataframe with columns with special characters
Specifically here is the column name that is giving me trouble: "Src. of Business Contact Full Name"