Вы можете сделать что-то вроде:
grouped = df.groupby('Client')
bound = int(np.ceil(len(grouped)*0.8))-1
chunk1 = [g[1] for g in list(grouped)[:bound]]
chunk2 = [g[1] for g in list(grouped)[bound:]]
Для следующего примера кадра данных:
Client Product Data
0 Client1 ProductA Data1
1 Client2 ProductA Data3
2 Client3 ProductB Data1
3 Client4 ProductA Data2
4 Client5 ProductB Data1
5 Client2 ProductA Data1
6 Client3 ProductA Data3
7 Client2 ProductB Data1
8 Client3 ProductB Data1
9 Client5 ProductA Data2
10 Client1 ProductA Data1
11 Client1 ProductB Data1
12 Client4 ProductA Data2
13 Client3 ProductB Data2
14 Client2 ProductB Data3
chunk1
даст:
Client Product Data
0 Client1 ProductA Data1
10 Client1 ProductA Data1
11 Client1 ProductB Data1
Client Product Data
1 Client2 ProductA Data3
5 Client2 ProductA Data1
7 Client2 ProductB Data1
14 Client2 ProductB Data3
Client Product Data
2 Client3 ProductB Data1
6 Client3 ProductA Data3
8 Client3 ProductB Data1
13 Client3 ProductB Data2
И chunk2
даст:
Client Product Data
3 Client4 ProductA Data2
12 Client4 ProductA Data2
Client Product Data
4 Client5 ProductB Data1
9 Client5 ProductA Data2