I have a dataframe which I want to modify in a way that each row will containt the column name . for example :
FirstName LastName Jhon Doe David Lue to create the follwing
(FirstName=Jhon,LastName=Doe) (FirstName=David,LastName=Lue) I managed to do for df with 2 columns
val x = df.map { row => (names(0) + "=" +row(0) , names(1)+"="+rows(1)} but how can I do it with for loop for any number of columns?
Thanks