Feed on
Posts
Comments

Importing arrays from numpy to rpy2 can throw the following error:

ValueError: Nothing can be done for the type <type ‘numpy.ndarray’> at the moment.

To resolve, add the following to the top of your Python code:

import rpy2.robjects.numpy2ri

rpy2.robjects.numpy2ri.activate()


Bookmark and Share

if that was helpful ...

check out the other tips and tricks i've compiled on these pages. you might learn something else interesting!

Did I get this wrong? Let me know!

Trackback URI | Comments RSS

More blogs about http://desk.stinkpot.org:8080/tricks.