Sorry if the title doesn't make a lot of sense.
I have a large df as follows:
client referer
IP1 producta
IP2 productb
IP1 productc
IP4 productb
IP5 productd
IP4 producte
IP5 productf
IP5 productg
and so on. For each 'client' value there are sometimes more than 1 'referer' values. I want a df as follows:
client referer1 referer2 referer3 ...
IP1 producta productc
IP2 productb
IP4 productb producte
IP5 productd productf productg
.
.
.
I've tried:
d4 = df2.groupby('client') which did nothing.
d4 = df2.pivot_table(index=['client'], columns = 'referer' which gives DataError: No numeric types to aggregate.
('client' and 'referer' columns are both categorical.)
Any ideas what I can do?
EDIT I am working on 10365152 rows so a lot of solutions give me Memoryerrors.