I'm wondering about "sex" (what else is new ;-), wouldn't:

'M'=]

work better?
------------------------------------------------------------------------
|\/| Randy A MacDonald   | APL: If you can say it, it's done.. (ram)
|/\| [EMAIL PROTECTED]  |
|\ |                     |If you cannot describe what you are doing
BSc(Math) UNBF'83        þas a process, you don't know what you're doing.
Sapere Aude              |     - W. E. Deming
Natural Born APL'er      | Demo website: http://156.34.82.41/
-----------------------------------------------------(INTP)----{ gnat }-

----- Original Message ----- 
From: "Dan Bron" <[EMAIL PROTECTED]>
To: "Programming forum" <[email protected]>
Sent: Friday, May 26, 2006 12:31 PM
Subject: RE: [Jprogramming] Connect the dots


> John,
>
> You've given me exactly what I'm looking for.  Thank you.
>
> By the way, index into nub is not required.  It is the job of the metrics
to categorize the aspects.  Now my code looks like this:
>
>
>    aspects =: }. <@:>"1 |: }. > cut &.> LF cut data
>    aspects
> +-----+----+--+-+------+
> |5'10"|170#|34|M|Black |
> |5'10"|190#|25|M|Black |
> |5'3" |110#|23|F|Blonde|
> |6'1" |210#|37|M|Blonde|
> +-----+----+--+-+------+
>
>    height  =.  6 s: s:
>    weight  =.  0 "."0 {."1  NB.  Weight, first digit
>    age     =.  0 "."0 {."1  NB.  Age, decade
>    sex     =.  'M' = ,      NB.  Are you a man, or a ...
>    hair    =.  6 s: s:
>    metrics =.  height`weight`age`sex`hair
>
>    buckets =: ,/ 1 metrics@>;.1 aspects
>    buckets
> 1 1 2 3
> 1 1 1 2
> 3 2 2 3
> 1 1 0 1
> 4 4 5 5
>
>    jjss -: (<@:(</.)"1  i.@:{:@:$) buckets  NB.  Isomorphic representation
> 1
>
> Thanks again!  (To Roger and Oleg, too)
>
> -Dan
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>


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

Reply via email to