Advertisement
Guest User

Untitled

a guest
Jun 30th, 2015
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. import subprocess as sub
  2. import d2vec_kmeans as d2v
  3. import numpy as np
  4.  
  5. # pull in text table
  6. raw = sub.Popen(['cat', '/Users/N/Desktop/dtas/ContagiousIndex/DOC2VEC/DATA/rawtextfinal.txt'], stdout=sub.PIPE)
  7. raw = raw.communicate()[0].split('\n')
  8. raw = [tuple(ele.split('\t')) for ele in raw if ele != '' and len(ele.split('\t')) == 5]
  9.  
  10. # store text
  11. raw_text = list(zip(*raw))[4]
  12. raw_text
  13. ids = list(zip(*raw))[0]
  14.  
  15. ...
  16.  
  17. ##error:
  18. Traceback (most recent call last):
  19.   File "/Users/Nick/Desktop/dtas/ContagiousIndex/DOC2VEC/CI_run_d2v.py", line 11, in <module>
  20.     print raw[0]
  21. IndexError: list index out of range
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement