partition by consecutive equal

hi guys,

i want to partition a list like?110010b into equal valued parts: (11b;00b;,1b;,0b)

is there a nicer way than this:?

q)a:110010b

q){(0,1+where(-1_x)<>1_x)_x}a

11b

00b

,1b

,0b

ta, jack

Hi Jack,
Is this what you’re looking for?

q)(where not 0=deltas a) cut a
11b
00b
,1b
,0b

Regards,
Stephen

ah haaaa - i haven’t used deltas before

q)deltas

-':

and i haven’t used eachprior before, either – so that’s how it’s done!

thanks for your help.

q)(where differ x)_ x:110010b
11b
00b
,1b
,0b