Pandas Dataframe – (Column re structure)

I have a dataframe that has n number of columns. These contain letters, the amount of letters a column contains varies and a letter can appear in various amounts of columns. I need the code for a pandas dataframe to convert the sheet to columns starting with the letters, the rows should contain the numbers of the columns that that letter was in.

Link to example problem

enter image description here

The image describes my problem better. Thank you in advance for any help.



Read more here: https://stackoverflow.com/questions/66305277/pandas-dataframe-column-re-structure

Content Attribution

This content was originally published by Daniel Sammon at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: