Hy I have a dataframe with the following structure
Id | Vehicle1 | Vehicle2 |
---|---|---|
1 | car | motorcycle |
2 | bike | car |
3 | motorcycle | bike |
And I want to group in one dataframe with onlyone column vehicle with that structure
Id | Vehicle |
---|---|
1 | car |
1 | motorcycle |
2 | bike |
2 | car |
3 | motorcycle |
3 | bike |
how can I do it with python/pandas?
I tried with groupby but i failed.
Thanks!