I'm having some trouble figuring out how to change a column in a DataFrame.
I can extract the column labeled X with:
df.rx2('X')
which seems to give me an R vector, which is good. But I can't figure out how to
iterate through that vector and manipulate it in python:
print [function(x) for x in df.rx2('X')] # error
for k,v in df.rx2('X').iteritems(): # also an error
and I also don't know how to replace that (python) vector back into the
DataFrame (I can use cbind to make a new column, but I'd rather replace the old
column with the new one).
This would be a good example for the DataFrame section of the docs, I think. Any
help appreciated!
JDO
------------------------------------------------------------------------------
_______________________________________________
rpy-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rpy-list