Using non-scalar converters with read_table
Following up on Wes's email from the pandas group: I was having a problem trying to use converters in "read_table". I have a file that looks like this:

```
id      value                                                                                                                                       
a       a=0,b=4,c=6                                                                                                                                 
b       a=10,b=5,c=-1                                                                                                                               
c       a=20,c=60                                                                                                                                   
d       a=430                                                                                                                                       
e       c=200                                                                                                                                       
```

The "id" field is unique and so can be used as an index with "read_table":

```
In [7]: df = p.read_table("test.csv", index_col=[0])
In [8]: df
Out[8]: 
   value        
id              
a  a=0,b=4,c=6  
b  a=10,b=5,c=-1
c  a=20,c=60    
d  a=430        
e  c=200   
```

The value field is constrained to have at most three values (for "a", "b" and "c"). I'd like to store that as a numpy array with canonical ordering where you have the value for a, b, c for each "id" entry, making each 0 if it is not present. My converter is:

```
import numpy as np                                                                                                                                  
def value_convert(value, fields=["a","b","c"]):                                                                                                     
    pairs = value.split(",")                                                                                                                        
    from collections import defaultdict                                                                                                             
    d = defaultdict(int)                                                                                                                            
    for pair in pairs:                                                                                                                              
        k, v = pair.split("=")                                                                                                                      
        d[k] = v                                                                                                                                    
    results = np.array([d[f] for f in fields],                                                                                                      
                       dtype='int64')                                                                                                               
    return results                                                                                                                                  
```

Example:

```
In [32]: value_convert(df["value"][0])
Out[32]: array([0, 4, 6])
```

If I try to use that as a converter:

```
df = p.read_table("test.csv", index_col=[0], converters={"value": value_convert})
```

I get the error:

```
/usr/local/lib/python2.6/dist-packages/numpy-1.5.1-py2.6-linux-x86_64.egg/numpy/lib/function_base.pyc in __call__(self, *args)
   1831         if self.nout == 1:
   1832             _res = array(self.ufunc(*newargs),copy=False,
-> 1833                          subok=True,dtype=self.otypes[0])
   1834         else:
   1835             _res = tuple([array(x,copy=False,subok=True,dtype=c) \

ValueError: setting an array element with a sequence.
```

I can get around this using apply:

```
In [37]: df["value"].apply(value_convert)
Out[37]: 
id
a     [0 4 6]
b     [10  5 -1]
c     [20  0 60]
d     [430   0   0]
e     [  0   0 200]
Name: value

In [38]: df["int_value"] = df["value"].apply(value_convert)
In [39]: df["int_value"]
Out[39]: 
id
a     [0 4 6]
b     [10  5 -1]
c     [20  0 60]
d     [430   0   0]
e     [  0   0 200]
Name: int_value
```

It would be convenient to access "int_value" as an array, e.g. pull out all the "a" values for all entries in the DataFrame, but this yeilds an error:

```
In [40]: df["int_value"][:, 0]
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (772, 0))
....
ValueError: Can only tuple-index with a MultiIndex
```

Though that might be a separate issue from the converters. Using "apply" works, but the idea of a converters is a very nice feature that I would in general like to use, since I run into this use case a lot. More important for me personally however is being able to slice these non-scalar values.

Thanks very much! best, Yarden
