How to convert array into dataframe

Hi All, Thanks in Advance!

I have used .collect function overt the Dataframe and stored in variable ‘A’ in scala. Now, How can we convert into this ‘A’ into Dataframe. I have used .toDF() function like below but it is throwing an error. Appreciate your help!

Thank you!