MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: A bug in Partition?

  • To: mathgroup at
  • Subject: [mg117390] Re: A bug in Partition?
  • From: "Sjoerd C. de Vries" <sjoerd.c.devries at>
  • Date: Thu, 17 Mar 2011 06:30:51 -0500 (EST)
  • References: <ilq72a$bpk$>


As far as I can see your Partition  call syntax does not correspond to
any of the listed possibilities. On the position of -1 a list
containing the intended position for the start of the list and the
intended position of the end of the list should be provided. Missing
this, I assume Mathematica will assume you both want them at the end
of their respective sublists. In this case all the constraints
together lead to a logical impossibility and i is dropped. Try
Partition[{a, b, c, d, e, f, g, i}, 3, 3, {-1, 1}, x] instead.

Cheers -- Sjoerd

On Mar 16, 12:31 pm, Alexey <lehi... at> wrote:
> Hello,
> Consider the following:
> In[3]:=
> Partition[{a,b,c,d,e,f,g,i},3,3,-1,x]
> Partition[{a,b,c,d,e,f,g,i},3,3,1,x]
> Out[3]=
> {{x,x,a},{b,c,d},{e,f,g}}
> Out[4]=
> {{a,b,c},{d,e,f},{g,i,x}}
> One can see that in the first case element 'i' is dropped! Why this
> happens? Is this intended behavior?

  • Prev by Date: StreamPlot or streamlines in 3D?
  • Next by Date: Re: three kinds of Euler angular unitary matrices
  • Previous by thread: A bug in Partition?
  • Next by thread: Re: A bug in Partition?