That said, note that +/"1 does "lose" the last dimension.
Thanks,
--
Raul
On Thu, Apr 16, 2020 at 5:30 PM Mike Powell wrote:
>
> Of course. (A place where J and APL differ.)
> Thanks Jan-Pieter.
>
> Mike
>
> > On Apr 16, 2020, at 12:00, Jan-Pieter Jacobs
> > wrote:
> >
> > Actually, the dime
Of course. (A place where J and APL differ.)
Thanks Jan-Pieter.
Mike
> On Apr 16, 2020, at 12:00, Jan-Pieter Jacobs
> wrote:
>
> Actually, the dimension lost is the first, as insert [0] (u/) inserts u
> between the items [1].
>
> Demonstration:
>
> $ foo =: i. 2 3 4
> 2 3 4
> $ +/ foo
>
Actually, the dimension lost is the first, as insert [0] (u/) inserts u
between the items [1].
Demonstration:
$ foo =: i. 2 3 4
2 3 4
$ +/ foo
3 4
[0]: https://code.jsoftware.com/wiki/Vocabulary/slash
[1]: https://code.jsoftware.com/wiki/Vocabulary/AET#Item
Cheers,
Jan-Pieter
Op wo 15 a
Am 15.04.2020 20:54 schrieb Mike Powell:
Thomas,
I J there is not really anything for a column vector. If an object,
like your rvec, has a single dimension it’s a vector. If it has two
dimensions, as does cvec, it’s a matrix. That’s different from most
conventional mathematical notation.
When y
i.3 3
0 1 2
3 4 5
6 7 8
mean i.3 3
3 4 5
|: i.3 3 NB. Transpose
0 3 6
1 4 7
2 5 8
mean |: i.3 3 NB. Now you can get the means of what used to be columns.
1 4 7
mean "1 i.3 3 NB. Another way to operate on columns, without transposing
the array.
1 4 7
Skip
Skip Cave
Cave Consulting L
Thomas,
I J there is not really anything for a column vector. If an object, like your
rvec, has a single dimension it’s a vector. If it has two dimensions, as does
cvec, it’s a matrix. That’s different from most conventional mathematical
notation.
When you do the summation with +/ you lose a d
Am 15.04.2020 19:50 schrieb 'Pascal Jasmin' via Programming:
sum (insert) and count apply to items. The items are the rows.
+/ 3 2 $ 1 2 3
6 6
the result is a list. If there is just 1 column (one result), it is
still a list.
Thanks everyone!
I think, I got it...
Kind regards,
Thomas
--
In other words, there is no such thing as a “column vector.”
It’s a matrix with “dimension“ 2.
A better way to phrase this is “has 2 axes” or, in J lingo,
as Don Guinn said, it’s about ranks.
You said
rvec =: 1 2 3
rather than
rvec =: 1 3 $ 1 2 3
but with cvec you told j to build a matrix aka ran
sum (insert) and count apply to items. The items are the rows.
+/ 3 2 $ 1 2 3
6 6
the result is a list. If there is just 1 column (one result), it is still a
list.
On Wednesday, April 15, 2020, 01:33:35 p.m. EDT, Thomas Bulka
wrote:
Hello everyone,
I do have some difficulties in
The rank is reduced by one. So the rank 2 is reduced to one.
On Wed, Apr 15, 2020, 11:33 AM Thomas Bulka wrote:
> Hello everyone,
>
> I do have some difficulties in understanding a certain behavior. Let's
> assume, I define the classical mean verb, a row vector and a column
> vector:
>
> mean =:
Hello everyone,
I do have some difficulties in understanding a certain behavior. Let's
assume, I define the classical mean verb, a row vector and a column
vector:
mean =: +/ % #
rvec =: 1 2 3
cvec =: 3 1 $ 1 2 3
When I apply mean to rvec I get the result 2 (as expected), which
happens to be
11 matches
Mail list logo