octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dataframe dereferencing


From: CdeMills
Subject: Re: dataframe dereferencing
Date: Mon, 13 Sep 2010 12:35:37 -0700 (PDT)


Judd Storrs-2 wrote:
> 
> On Wed, Sep 8, 2010 at 1:17 AM, Jaroslav Hajek <address@hidden> wrote:
> 
>> I don't think df{1:3,1:3} should return a cell array, but rather a
>> cs-list. Otherwise, df{1,1} should return a cell array as well.
>>
> 
> Oops. You're right.
> 
> Also, going back to Pascal's original .as.something idea. I hadn't
> realized
> that the cast can be implemented generically using the cast()
> function--so,
> I was completely off base to assert that adding new types would require
> modifying @dataframe/subsref since .as.something simply receives passes
> "something" as a string inside the idx parameter to subsref() and calls
> cast() using the string. Which seems to be what Pascal has done. Not
> needing
> to modify subsref totally invalidates my concerns. In my testing with
> dataframe things seem to work fine so far (I haven't done anything
> extremely
> fancy) So... maybe I should just say "nevermind" and shut up.
> 

Back from the land of every-kind-of-meat-with-schnitzel. I implemented a {}
access, wich returns a cell array from the selected range, without header.
In the name of the principle of least surprise, if selected columns are not
compatible together and the output format was not selected, an error is
produced. To summarise :
df() returns a matrix, with demotion if type are differents
df{} returns a cell array, without header
df.dataframe() returns a sub-dataframe
df.cell() returns a sub-view with rows and columns headers
df.as.something returns a matrix, casting every entry to 'something'

The changes are pushed into sourceforge svn. Judd and Jaroslav, could you
test it and see if this fits your views before I make a new release ?

Regards

Pascal
-- 
View this message in context: 
http://octave.1599824.n4.nabble.com/dataframe-dereferencing-tp2494732p2537972.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]