arrange values in a python 2D array
<p>I'm new to python and I'm having a problem that I'm not able to solve.</p>

<p>I have the following 2D array:</p>

<pre><code>valuearray = [['A', '21', '45'], ['A', '12', '23'], 
              ['A', '54', '21'], ['A', '15', '54'], 
              ['B', '23', '53'], ['B', '34', '53'], 
              ['B', '32', '54'], ['B', '24', '13'], 
              ['C', '31', '43'], ['C', '42', '54'], 
              ['C', '35', '54'], ['C', '12', '11']]

A  21 45
A  12 23
A  54 21
A  15 54
B  23 53
B  34 53
B  32 54
B  24 13
C  31 43
C  42 54
C  35 54
C  12 11
</code></pre>

<p>I need to generate from this array another array that have the unique values of <code>valuearray[0]</code> , the maximum of <code>valuearray[1</code>] for each <code>valuearray[0]</code>  and the minimum <code>valuearray[2]</code> for each <code>valuearray[0]</code></p>

<p>The result would be:</p>

<pre><code>resarray[]

    A  54 21
    B  34 13
    C  42 11
</code></pre>

<p><em><strong>EDIT: sorry for not presenting what I tried</em></strong></p>

<pre><code>    uniquenames = []
    un = []
    for i in range(len(valuearray)):
            un.append(valuearray[i][0])
    uniquenames=uniq(un)

test = []
for ci in range(len(valuearray)):
    for gn in range(len(uniquenames)):
        if(valuearray[ci][0] == uniquenames[gn]):
                      # i don't know what to do here
                      i tried append(valuearray[ci][0] , max(valuearray[ci][1]),min( valuearray[ci][2]))
</code></pre>

<p>but append only take one parametre, so I don't know how to continue.</p>

<p>And uniq is a function that gives me the unique values from a list. </p>
