Вопрос

I am getting some unexpected behaviour with rypy2:

 ma / robjects.r.rowSums(ma) 

where ma is a matrix

throws an exception

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for /: 'Matrix' and 'FloatVector'

Any help?

Это было полезно?

Решение

Python operators might differ from R operators.

A self-contained example is not provided with the question, but this should work

ma.ro / robjects.r.rowSums(ma) 
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top