I need some help with forming a new variable in a dataframe I have a very large dataset were i want to make a new variable from existing data in another column. Here is an example.
>>> df
A B
0 a 1
1 b 2
2 c 3
3 a 5
4 d 6
I wwant to create a new column with the values a and c in A and name them ac, and the b and d and name them bd Final result should look like. Kind of grouping them from A and give the group a new name in a new column.
>>> df
A B C
0 a 1 ac
1 b 2 bd
2 c 3 ac
3 a 5 ac
4 d 6 bd
/Jonas