I believe Henry meant to say:

   ~.@(, i.@#@$) |: ]

For example:

   $1 2 (~.@(, i.@#@$) |: ]) i. 2 3 5 7 11
3 5 2 7 11

Though, I imagine the typical case identifies only a single dimension
in the left argument and a lower dimensional array in the right
argument.  For example:

   $ 1 (~.@(, i.@#@$) |: ]) i.2 3
3 2

And, of course, this result is intended to be used with a
corresponding rank argument (f"1 or f"_1 for some verb 'f' in this
last example, and f"3 or f"_2 for the previous example).

I hope this helps,

-- 
Raul

On Wed, Sep 6, 2023 at 6:33 PM Henry Rich <henryhr...@gmail.com> wrote:
>
> Since you want all the slices, what you are looking for is a transpose.
>
> Maybe
>
> ~.@(, i.@#) |: ]
>
> Untested.
>
> Henry Rich
>
> On Wed, Sep 6, 2023, 6:10 PM Piet de Jong <pietd...@gmail.com> wrote:
>
> > Here is my “wish"
> >
> > A dyadic (tacit) verb such that x v y gives all the slices of y along
> > dimension x, where x is integer.   That is to say
> >
> >  i{ x v y
> >
> > is slice i of the array y along dimension x.
> >
> > Thanks for all your help!
> >
> > > On 7 Sep 2023, at 08:04, 'robert therriault' via Programming <
> > programm...@jsoftware.com> wrote:
> > >
> > > Or something like this?
> > >
> > >    [n =. i. 2 2 2
> > > 0 1
> > > 2 3
> > >
> > > 4 5
> > > 6 7
> > >   ,./ n
> > > 0 1 4 5
> > > 2 3 6 7
> > >  ($ $ (,@,./)) n
> > > 0 1
> > > 4 5
> > >
> > > 2 3
> > > 6 7
> > >
> > > Cheers, bob
> > >
> > >
> > >> On Sep 6, 2023, at 14:49, 'robert therriault' via Programming <
> > programm...@jsoftware.com> wrote:
> > >>
> > >> Hi Piet,
> > >>
> > >> Maybe show us what you would want to do with higher dimensions? Or a
> > less symmetric 2 dimensional shape?
> > >>
> > >> For shape 2 2, I would use the even simpler
> > >>
> > >>   |: m
> > >> 0 2
> > >> 1 3
> > >>
> > >> Hope this helps.
> > >>
> > >> Cheers, bob
> > >>
> > >>> On Sep 6, 2023, at 14:26, Brian Schott <schott.br...@gmail.com> wrote:
> > >>>
> > >>> ,./0 1 {"1  m
> > >>
> > >> ----------------------------------------------------------------------
> > >> For information about J forums see http://www.jsoftware.com/forums.htm
> > >
> > > ----------------------------------------------------------------------
> > > For information about J forums see http://www.jsoftware.com/forums.htm
> >
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
> ----------------------------------------------------------------------
> 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