ptwobrussell / Mining-the-Social-Web-2nd-Edition

The official online compendium for Mining the Social Web, 2nd Edition (O'Reilly, 2013)
http://bit.ly/135dHfs
Other
2.9k stars 1.49k forks source link

Chapter 4 - Mining Google+ - IPython Name error thrown (Example 8 NLTK) #105

Closed mmeanwe closed 10 years ago

mmeanwe commented 10 years ago

Any ideas on below error? Thanks!

NameError Traceback (most recent call last)

in () 7 nltk.download('stopwords') 8 ----> 9 all_content = " ".join([ a['object']['content'] for a in activity_results ]) 10 11 # Approximate bytes of text NameError: name 'activity_results' is not defined [nltk_data] Downloading package 'stopwords' to /usr/share/nltk_data... [nltk_data] Package stopwords is already up-to-date!
ptwobrussell commented 10 years ago

This is just telling you that the variable activity_results hasn't yet been populated with a value, so it is undefined. Assuming you have executed prior cells in the notebook that assign it a value, though, this shouldn't be the case. My recommendation is to double-check that you've executed the prior cells that populate it. Let me know if this makes sense. (And just to be clear, the error has nothing to do with nltk.)

mmeanwe commented 10 years ago

Re-ran few of the prior examples (had executed out of sequence) including the API key and that sorted it out.

Thanks for the quick response - the IPython guide and book are great.