Код: Выделить всё
import pandas as pd
pd.DataFrame({'A': ['a', 'a', 'b', 'b'], 'B': ['x1', 'x2', 'x3', 'x4']})
Код: Выделить всё
A B
0 a x1
1 a x2
2 b x3
3 b x4
Код: Выделить всё
A B1 B2
0 a x1 x2
1 b x3 x4
Подробнее здесь: https://stackoverflow.com/questions/791 ... d-on-value