This may also occur if your items are mostly scalars but you have an empty
one (a vector of length zero):
   ]lst=. 1;1;0;1;0;'';0;1;1;1;0
+-+-+-+-+-++-+-+-+-+-+
|1|1|0|1|0||0|1|1|1|0|
+-+-+-+-+-++-+-+-+-+-+
   >lst
1
1
0
1
0
0
0
1
1
1
0
The disclose treats them all as vectors since there is one vector so you
have the trailing dimension of one.

On Mon, Jun 29, 2020 at 10:49 PM Julian Fondren <[email protected]>
wrote:

> On 2020-06-29 21:26, HH PackRat wrote:
> ...
> > This is "a2":
> > ┌─┬─┬─┬─┬
> > │1 │ 1│1│ 0│ . . .
> > └─┴─┴─┴─┴
> >
> > a3=. > a2
> >
> > The following SHOULD be "a3" (as far as I know):
> >   1  1  1  0 . . .
> >
> > but "a3" ends up like this:
> >   1
> >   1
> >   1
> >   0
> >  . . .
> >
> > And if I transpose this "a3", I end up with this:
> >   1110 . . .
> >
> >
> > Small "live" examples (not a script) work fine:
> >
> > ]a2=. 1;1;1;0;0;0
> >
> > ┌─┬─┬─┬─┬─┬─┐
> > │ 1│ 1│1│ 0│ 0│ 0│
> > └─┴─┴─┴─┴─┴─┘
> >
> > ]a3=. > a2
> >
> >   1 1 1 0 0 0
> >
>
>     ]a=: ' '&, each <"0 '111000'
> ┌──┬──┬──┬──┬──┬──┐
> │ 1│ 1│ 1│ 0│ 0│ 0│
> └──┴──┴──┴──┴──┴──┘
>     >a
>   1
>   1
>   1
>   0
>   0
>   0
>     |:a
> ┌──┬──┬──┬──┬──┬──┐
> │ 1│ 1│ 1│ 0│ 0│ 0│
> └──┴──┴──┴──┴──┴──┘
>     |:>a
>
> 111000
>     datatype each a
> ┌───────┬───────┬───────┬───────┬───────┬───────┐
> │literal│literal│literal│literal│literal│literal│
> └───────┴───────┴───────┴───────┴───────┴───────┘
>
> The problem looks to be that you have strings where you expect
> to have numbers. A quick solution then is to convert your
> strings to numbers.
>
>     > 0&". each a
> 1 1 1 0 0 0
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>


-- 

Devon McCormick, CFA

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

Reply via email to