Re: Part ([[...]]) and span (;;)
- To: mathgroup at smc.vnet.net
- Subject: [mg84623] Re: Part ([[...]]) and span (;;)
- From: Norbert Marxer <marxer at mec.li>
- Date: Mon, 7 Jan 2008 02:40:45 -0500 (EST)
- References: <flqcg3$k5e$1@smc.vnet.net>
On 6 Jan., 12:02, nigol <dario.butt... at gmail.com> wrote: > In the Mathematica 6 help is written: > =A0 =A0Common spans of parts include: > =A0 =A0expr[[;;,j]] =A0 =A0 =A0 =A0 =A0 column j > =A0 =A0If any of the Subscript[list, i] are All or ;;, all parts at that > level are kept. > > On my platform the following works: > In[1]:= {{a, b, c}, {d, e, f}, {g, h, i}}[[All, 2]] > Out[1]= {b, e, h} > > but the following does not work: > {{a, b, c}, {d, e, f}, {g, h, i}}[[;; , 2]] > Syntax::sntxf: ";;" cannot be followed by ",2". > Syntax::tsntxi: ",2" is incomplete; more input is needed. > Syntax::sntxi: Incomplete expression; more input is needed. > > In[2]:= $Version > Out[2]= "6.0 for Microsoft Windows (32-bit) (June 19, 2007)" > > Is this problem common to other platforms? > Thanks, > Dario Hello The documentation (at "More Information" for "Part") is not correct. As cou can see under "Basic Examples" a few lines further down you have to use (;;) instead of just ;; i.e. {{a, b, c}, {d, e, f}, {g, h, i}}[[(;;), 2]] works as expected. Best Regards Norbert Marxer