Reputation: 33
I need to convert an SFrame column to a list.
input :
`+---------+
| word |
+---------+
| love |
| loves |
| easy |
| perfect |
| great |
+---------+`
output:
['love', 'loves', 'easy', 'perfect', 'great']
Upvotes: 2
Views: 4390
Reputation: 1027
I'm surprised the list
function gave you an error. This works for me:
import graphlab as gl
sf = gl.SFrame({'fruit': ['apple', 'banana', 'pear']})
list(sf['fruit'])
Returns:
['apple', 'banana', 'pear']
Upvotes: 10
Reputation: 366
HINT: you can convert it to an array using:
arr = sf.to_numpy()
Upvotes: 0