TF-IDF indexError

User 5193 | 5/13/2016, 7:55:14 AM

people['tfidf'] = tfidf['docs']


IndexError Traceback (most recent call last) <ipython-input-38-96305a5659f9> in <module>() ----> 1 people['tfidf'] = tfidf['docs']

/Users/Parkjoonho/anaconda/envs/dato-env/lib/python2.7/site-packages/graphlab/datastructures/sarray.pyc in getitem(self, other) 1084 return SArray(proxy = self.proxy.copy_range(start, step, stop)) 1085 else: -> 1086 raise IndexError("Invalid type to use for indexing") 1087 1088 def materialize(self):

IndexError: Invalid type to use for indexing

os : mac. dato Trial ver.

Comments

User 12 | 5/13/2016, 5:33:40 PM

Hi @parkjoonho, can you give us a little more context about the code and data that led to this error? Thanks, Brian


User 5193 | 5/16/2016, 12:05:37 AM


User 12 | 5/16/2016, 10:17:59 PM

Try doing

people['tfidf'] = tfidf

The tfidf object in your notebook is a graphlab.SArray, so it's already in the right shape to be an SFrame column.


User 5193 | 5/17/2016, 8:32:14 AM

and people = graphlab.SFrame('people_wiki.gl/') change

people = graphlab.SArray('people_wiki.gl/') ok?


User 12 | 5/17/2016, 4:51:47 PM

I'm sorry, I don't understand the question - you'll have to elaborate a bit. Thanks, Brian