Raul Miller <[email protected]> writes:

> For starters, I would parse your data like this:
>
> 'area source year qtr hpi'=:|:}.<;._2@,&',';._2 htData
> 'year qtr hpi'=:".L:0 year;qtr;hpi

Thanks, that's interesting.  It took me a depressingly long time to
understand that first phrase, but it was illuminating.  I'd not used
cut at all before.  For the second, I'll have to work on understanding
L: more.  My first impulse would be to use something like ".@< .  I
still don't quite understand when L: is appropriate.

> That said, I think tables in J are best represented as columns -- each
> column has a name (it's a variable) and columns from the same table
> are the same length (indices on one column work on the other columns
> from that table).

Well, I was thinking that if I had the entire table stored as a boxed
array of some sort, then I could do selections on the entire table at
once.  For example, when I was trying to extract just the subset that
had area-.'US', if I could do

  tableUS=. ('US'-."1 'area' tableGetRow table) tableCopy table

with some appropriate definitions of verbs tableGetRow and tableCopy,
and data structure table.

I've not seen anyone doing this, so it seems like it must be a bad idea,
but I don't understand why yet.


> Does this get you started?
>
> Or did I overlook an important question?

No, that's helpful.

Thanks,
Johann

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to