Skip to content
Advertisement

Tag: edge-list

Stacking a number of columns into one column in python

I have a pandas dataframe of 100 rows x 7 columns like this: Values in column source are connected to the values in the other columns. For example, a is connected to contact_1, contact_2… contact_5. In the same way, b is connected to contact_6, contact_7 …. and contact_10. I want to stack these columns into two columns only (i.e. source

Advertisement