I have a dataframe with new variable name(col2) and old variable name(col1).
I have another dataframe (tf) with columns (named as in col1)
Desired result (tf_new) is to convert the column names into names in col2 (abs->fc_abc)
I have tried to avoid udf uptil now by doing the below:
#converting df into rdd
newrdd = df.rdd
#generating a map
keypair_rdd = newrdd.map(lambda x : (x[1],x[0]))
#creating key value pair
dict = keypair_rdd.collectAsMap()
Need help with using the dict to transform tf into tf_new.
Similar solution in Python would also be of great help.