In [4]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import pensieve as pv

In [5]:
book = 'book1'

In [6]:
doc = pv.Doc('../../clusterpot/%s.txt' %book)
book_emotions = pd.read_hdf('book_emo.h5',key=book)

In [14]:
slength = [float(len(doc.paragraphs[i].text.split())) for i in range(len(doc.paragraphs))]


---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-14-8ea99682d340> in <module>()
      1 slength = [float(len(doc.paragraphs[i].text.split())) for i in range(len(doc.paragraphs))]
----> 2 book_emotions.as_matrix()/slength

ValueError: operands could not be broadcast together with shapes (3240,6) (3240,) 

In [ ]: