Thanks Mark and Laurent, your suggestions were very useful. Turning off
RPy conversion helped me a lot; I'll check later the rpy2 thing. Thank
you very much.
En/na Laurent Gautier ha escrit:
> Albert Meroño Peñuela wrote:
>> Hello everyone,
>>
>> I'm writing a little script in Python which inten
Albert Meroño Peñuela wrote:
> Hello everyone,
>
> I'm writing a little script in Python which intends to sort a table of
> word frequency in a text, using R functions from rpy package. I've got
> my word list; when I use the R table function I obtain a list which
> contains que frequencies, bu
> table = r.table(wordsvector)
The table function returns a _contingency table_ object, which rpy
tries to unsuccessfully convert into a numpy array.
See if this returns something more workable:
rObj = with_mode(NO_CONVERSION, r.table)(words)
aHash = {}
[aHash.update(i) for i in rObj]
print aHas