Posts

Showing posts with the label transpose

Auto Transform into New Data - Pandas

Auto Transform into New Data - Pandas I am a newbie in python, I search in StackOverflow for my case but I couldn't find the technical answer. I have a big number of BS row. my problem like this, I have a dataframe : dataframe df BS N BS1 - BS5 1 BS2 - BS7 2 BS1 - BS9 2 BS9 - BS1 1 I want to make new data automatically. My expected result like this: New_BS BS1 - BS5 BS2 - BS7 BS1 - BS9 BS9 - BS1 Total BS1-2 1 2 3 BS2-3 1 2 2 5 BS3-4 1 2 2 5 BS4-5 1 2 2 5 BS5-6 2 2 4 BS6-7 2 2 4 BS7-8 2 2 BS8-9 2 2 BS9-8 1 1 BS8-7 ...