Remove special characters from column header of dataframe

 import dataiku
import pandas as pd

d_dataset=dataset("abc")
d_df=d_dataset.get_dataframe()

d_df.columns=d_df.columns.str.replace("[$_() ]".'')

df_output=dataiku.Dataset("df_output")
df_output=write_with_schema(df_output)

Note:- Dataframe name should be same when you apply replace function as amrked in yellow.

Comments

Popular posts from this blog

Date format issue with spark sql

Hive Partition sub folders HIVE_UNION_SUBDIR_1,HIVE_UNION_SUBDIR_2,HIVE_UNION_SUBDIR_8

Dataiku and Dremio date difference