I need to unpivot a dataset with the column names in date format. To un-pivot, I would need to call column names, but they would keep changing every month; hence, I cannot use column names because of their dynamic nature. Here is an example of the table:
I need to un-pivot these date columns and I cannot call column names as these columns may change next month. Here is the desired output:
Could you please help me with any solution for this in spark SQL or Pandas as I am using Palantir foundry.
Note:
- There are hundreds of rows in data, this only one row is a sample example.
- If I rename column names, changing them back to date columns would be difficult as well.
Thanks.