Logical help to get arranged data from python lists? : <p>I have an problem to solve but i am getting confused on how to resolve it
I have two list with some data corresponding to each other.</p>

<pre><code>For ex:
A a1
A a2
A a3
B b1
B b2
B a1
A c1
A c2
C c1
C c2
C c3
C c4
D b1
</code></pre>

<p>I want to solve above problem like :-</p>

<pre><code>ID Count Data
A    3    a1,a2,a3
B    2    b1 b2
B    1    a1
A    1    c1
A    1    c1
C    4    c1, c2, c3, c4
D    1    b1  
</code></pre>
