On 21/05/10 00:08, John Owens wrote:
> I'd like to do two (actually three) things:
>
> 1) Using a grep-like operator, delete rows in a dataframe that match a
> particular pattern in a particular column (in my case, every row that
> has a '#' as the first character in column 'a')
> 2) Set el
I'd like to do two (actually three) things:
1) Using a grep-like operator, delete rows in a dataframe that match a
particular pattern in a particular column (in my case, every row that
has a '#' as the first character in column 'a')
2) Set elements in a dataframe based on the characteristics
Hi all,
I have a mixed-type structured numpy array (including columns of ints,
floats and strings), sometimes with missing values. In rpy2-2.1, what is
the recommended (including fastest and least memory-expensive) way to
convert such a structure to an R dataframe? Here's where I've been:
1)
>> I have a list-of-lists that I want to convert to an R dataframe. (In R, it
>> should end up as 306 rows by 12 columns.) The rpy2 instructions suggested
>> in this forum were basically: (1) convert my list of lists to a list of
>> array.array()s, (2) convert each array.array() to an RVector,
Actually, I hadn't. But trying it gave me the same "raveled" result:
>>> len(dl)
12
>>> map(len,dl)
[306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306]
>>> x=ro.r['data.frame'](dl)
>>> len(x)
3672
>>>
On Sat, 13 Dec 2008, Marcos Silva wrote:
> Well, I don't know RPy nor Python enought
Gary Strangman wrote:
> Hi again,
>
> I have a list-of-lists that I want to convert to an R dataframe. (In R, it
> should end up as 306 rows by 12 columns.) The rpy2 instructions suggested
> in this forum were basically: (1) convert my list of lists to a list of
> array.array()s, (2) convert ea
Well, I don't know RPy nor Python enought, and maybe I misunderstand your
data structure, but did you tried the RPy corresponding to the R
function"as.data.frame(dl)"
Cheers
2008/12/13 Gary Strangman
>
> Hi again,
>
> I have a list-of-lists that I want to convert to an R dataframe. (In R, it
>
Hi again,
I have a list-of-lists that I want to convert to an R dataframe. (In R, it
should end up as 306 rows by 12 columns.) The rpy2 instructions suggested
in this forum were basically: (1) convert my list of lists to a list of
array.array()s, (2) convert each array.array() to an RVector, (
Thanks much! Should have searched harder I guess.
MJ
-Original Message-
From: laurent [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 28, 2008 2:08 PM
To: Mark Janikas
Cc: RPy help, support and design discussion list
Subject: Re: [Rpy] DataFrame
On Tue, 2008-10-28 at 13:35 -0700
On Tue, 2008-10-28 at 13:35 -0700, Mark Janikas wrote:
> In rpy you were able to create a dataframe from a dictionary. Is
> there a way to do that in rpy2? It appears you need to use a
> taggedlist now. Any info would be greatly appreciated. TY,
This was discussed recently on the mailing-lis
In rpy you were able to create a dataframe from a dictionary. Is there a way
to do that in rpy2? It appears you need to use a taggedlist now. Any info
would be greatly appreciated. TY,
MJ
EXAMPLE:
In [29]: from rpy import *
In [30]: set_default_mode(NO_CONVERSION)
In [31]: d = {"Test":[1,2
11 matches
Mail list logo