Nice - I didn't realize dyalog had a blog. Looks like great content. It may
be time to finally learn a bit of APL to have a passing reading
comprehension in it. I have stopped and started the Dyalog book a few times
over the years as I have wanted to digest some of the Essays but that is
probably
Sorry for the confusion. Yes, it is a character matrix. In this case it is
a text file with one line per numeric value that is read with fread. I
don't box the values
I was using boxed arrays as a shorthand to create the character matrix
sample. I find it easier sometimes to do that for sample -
Not nested boxes (for example).
But point taken.
Thanks,
--
Raul
On Fri, Apr 13, 2018 at 6:11 PM, Roger Hui wrote:
> They do _under_ conversion to numbers and under open.
>
>
>
> On Fri, Apr 13, 2018 at 2:49 PM, Raul Miller wrote:
>
>> I
They do _under_ conversion to numbers and under open.
On Fri, Apr 13, 2018 at 2:49 PM, Raul Miller wrote:
> I remember at one point wishing that these would all work on character
> and boxed data.
>
> Thanks,
>
> --
> Raul
>
>
> On Fri, Apr 13, 2018 at 4:25 PM, Roger
I remember at one point wishing that these would all work on character
and boxed data.
Thanks,
--
Raul
On Fri, Apr 13, 2018 at 4:25 PM, Roger Hui wrote:
> It's useful to have at your fingertips a (small) set of manoeuvers:
>
> x * 0 = 0
> x * 1 = x
>
> x ^ 0 = 1
>
It's useful to have at your fingertips a (small) set of manoeuvers:
x * 0 = 0
x * 1 = x
x ^ 0 = 1
x ^ 1 = x
etc.
The Y {~ X i. x phrase, for mapping cells in X to values in Y, is also
generally useful. See the Dyalog APL blog post Calcultion v Look-Up
I had trouble myself understanding what Joe was driving at, and that
lead to my mistaken call for better sample data.
What Joe is working with is a character matrix - one row of characters
represents one number. So there will be multiple columns in the source
data and that corresponds to a list
Roger said that the boxed sample was only for illustration. But then, where
does the empty box come from? Or is this a comma or tab delimited file?
Granted, if the original file is pretty trashy then it is probably
necessary to do some clean-up ending out in table of boxes. But if the data
is
Don - the source data is a text file of float data that is being read into J
Roger - thanks, for the confirmation. I find that when I'm way from J/APL
for awhile, my mind drifts back into "if/then" thinking instead of the
simpler and faster method of using multiplication where possible. I fiddled
Yes, it's a boon that 0 * x is 0 for any x. Some authors go even further:
Knuth propose to have 0 * x be 0 even when x is an expression which is in
error. He wanted this to make "Iverson's convention" work in more
situations. See https://arxiv.org/PS_cache/math/pdf/9205/9205211v1.pdf
On Fri,
He's using boxed arrays only to generate the small sample data.
On Fri, Apr 13, 2018 at 12:43 PM, Don Guinn wrote:
> Just out of curiosity, surely the data didn't start out as an array of
> boxes. Perhaps it might be faster not to have everything boxed. Validation
> could
There is no faster way, although you can speed up "isblank":
[: -. {.@(0&{.) -:"1 ]
It's wasteful to catenate ' ' to a great big array only to take and drop
its first cell.
On Fri, Apr 13, 2018 at 12:24 PM, Joe Bogner wrote:
> Well, I stumbled upon a fast way that
Well, I stumbled upon a fast way that takes advantage of simple
multiplication
_ * 0 = 0
_ * 1 = _
5 * 1 = 5
_3 {. (-.@isblank * _&".) c1
1.01 _ 0
(6!:2) '(isblank * _&".) c1'
1.00593
I'm still interested in alternatives that are similar speed if possible
On Fri, Apr 13, 2018 at
Thank you -- Yes, I didn't want to send along the full sample, although I
could have created some dummy data.
Both Don and Raul's method are similar and are equally slow as the way I had
It's not terribly important but I have like 10 numeric columns that I
convert in a script and have to
Is this what you want?
_".&>'';'bad';'10'
0
_
10
On Fri, Apr 13, 2018 at 12:03 PM, Joe Bogner wrote:
> I have a large byte array that I want to convert to a number array. I want
> to use _ to indicate a bad value, but blank should be treated as 0
>
> $ c
> 4862343 10
15 matches
Mail list logo