Hi all,
I have a data which looks like this,
Input:
man1 car
man1 wallet
man1 shirt
man1 shirt
man2 truck
man2 house
man2 jacket
man2 jacket
man2 jacjet
man2 computer
I want to collect the data, but while collecting I want to count them as well
So the the output should look somewhat like this.
Output:
man1 car(1),wallet(1),shirt(2)
man2 truck(1),house(1),jacket(3),computer(1)
I tried putting it as a dictionary but then I am loosing the order in the data.
Please help me I have been trying this for a long time...
/dnyansagar