octave-maintainers
[Top][All Lists]
Advanced

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

Re: dataframe dereferencing


From: Judd Storrs
Subject: Re: dataframe dereferencing
Date: Sat, 4 Sep 2010 10:46:36 -0400

On Sat, Sep 4, 2010 at 9:00 AM, Jaroslav Hajek <address@hidden> wrote:
It wouldn't, I'm afraid. dataframe apparently stores a collection of
columns (arrays, which is a good idea), so as_cell(df) would imply
conversion of the whole dataframe, which would then be indexed. On the
contrary, as_cell (df(I,J)) would first index the dataframe, creating
another dataframe to convert to a cell. df.as.cell(I,J) could even
skip forming the intermediary dataframe and directly form the result
from the appropriate portions of relevant columns.

The point isn't the implementation, it's the syntax.  Without going into lots of detail, if you want to think about how as_cell(df(I,J)) can be made as efficient as a direct function call e.g. as_cell(df,I,J) you should consider what returning an @dataframeview object as the result of df(I,J) instead of an full @dataframe (or cell) might achieve. [caveat: from what I've read df() may automatically demote to matrix in some cases so that wrinkle would need to be worked out]

I don't like to be surprised by suddenly strange syntax because my memory and patience for strange/arbitrary annoyances is limited. I understand you like df.as.cell(I,J) -- it even looks sane in other languages. I don't because looking at it in Octave code I have no clue about what's going on, nor where to even look in the help system/documentation to find out what is going on. Even df(I,J,"as.cell") and df(I,J,"cell") would be better because at least I would know to look at @dataframe/subsref. That's just my opinion.


--judd


reply via email to

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