pandas.DataFrame.to_dict compatibility with sklearn.feature_extraction.DictVectorizer
#### Abstract
Currently pandas to_dict function and scikit-learn's sklearn.feature_extraction.DictVectorizer don't get along. I provide a simple script to make these compatible.

#### Description
Panda's current to_dict function returns a dictionary of the format:
`dict[column_name] <- (dict[index] <- val)`
Scikit-learn's DictVectorizer requires a list of dicts of the format:
`list[index] <- (dict[column_name] <- val)`

If pandas could provide this style of formatting as an optional parameter in the to_dict function, this issue could be easily resolved for future uses, as this is clearly an understandable indexing of a dataframe.

#### Gist Code
https://gist.github.com/ryanpeach/af3e7b217aa2fd5c98a262acce828da6

```
def pandas_to_dict(df):
    """ A to_dict method for pandas DataFrames that converts frames to a format
        compatible with sklearn.feature_extraction.DictVectorizer
        REF: http://scikit-learn.org/stable/modules/feature_extraction.html#dict-feature-extraction
        
        Parameters:
            df: DataFrame
            
        Returns:
            out_list: list indexed by df index, containing dicts indexed by column name referencing row value.
    """"
    # Get Index
    out_list = []
    for i in range(len(df)):
        index = df.iloc[i]
        
        # Get Column
        out_dict = {}
        for c in df.columns:
            out_dict[c] = index[c]
    
        # Add Column to the List
        out_list.append(out_dict)
        
    return out_list
```

Use it if you'd like, I wrote it for my own use and just wanted to make the community aware.

I posted this on scikit-learn as well.
