Python - Using Pandas to eliminated curly brackets and output floats
Question: Having this large csv data set, that essentially has x and y values in each
column.

    
    
    "{733.15, 179.5}",
    "{565.5, 642.5}",
    "{172.5, 375.5}",
    "{223.5, 554.5}",....
    
    ...., 
    "{213.5, 666.5}",
    "{851.5, 323.5}",
    "{498.5, 638.5}",
    "{763.5, 102.5}"
    

or by a table,

[![enter image description
here](http://i.stack.imgur.com/b0rsh.png)](http://i.stack.imgur.com/b0rsh.png)

A column is essentially this set and I can call each pair by indexing.

    
    
    import numpy as np
    import pandas as pd
    import csv
    
    brown = pd.read_csv('BrownM.csv',delimiter=',', header=None)
    
    print brown[0]
    

this essentially calls the row above

    
    
    print brown[0][0]
    

returns `{733.15, 179.5}`

but when wanting to select a value in this set,

    
    
       print brown[0][0][1]
    

returns `7`

It's treating this data set as a string, when I want it to return floats when
called upon.

Also, is their a way to pass the file to where the curly brackets are
eliminated?


Answer: Or you can `extract` then `split`.

    
    
    df.col1.str.extract(r'{(.*)}', expand=False).str.split(', ', expand=True)
    

* * *

### Timing

MaxU's solution is quicker as it does more in one step as opposed to mine that
takes two steps.

[![enter image description
here](http://i.stack.imgur.com/Ekenu.png)](http://i.stack.imgur.com/Ekenu.png)

