My code below works however it is replacing all nulls in the dataframe to "nI". I only want to replace nulls for the columns that are being renamed. I want to do this without hardcoding any column names.
df =datasetMatchedDomains
for i in TRUE_matchedAttributeName_List.keys():
df = df.withColumnRenamed(i,TRUE_matchedAttributeName_List[i]);
df_final=df.na.fill('NI')
display(df_final)
else:
print("clean")