MathGroup Archive 2012

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

Search the Archive

Re: Partition Help

  • To: mathgroup at smc.vnet.net
  • Subject: [mg126542] Re: Partition Help
  • From: Alexei Boulbitch <Alexei.Boulbitch at iee.lu>
  • Date: Fri, 18 May 2012 05:24:45 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

I'm getting an extra set of braces when trying to partition a matrix and don't understand how to correctly write the function or remove the extra braces.

data = (*Imported 6 column table*)
d1 = Partition[data, {1, 3}]
which results in {{{{-45000000, -10, 0}}, {{-419, 0, 1344}}},.....
I need it to be
{{{-45000000, -10, 0}, {-419, 0, 1344}},.......

Any help appreciated

Hi,
Flatten[ ] makes the job:

Flatten[{{{{-45000000, -10, 0}}, {{-419, 0, 1344}}}}, 1]

{{{-45000000, -10, 0}}, {{-419, 0, 1344}}}

Have fun, Alexei


Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG

Office phone :  +352-2454-2566
Office fax:       +352-2454-3566
mobile phone:  +49 151 52 40 66 44

e-mail: alexei.boulbitch at iee.lu







  • Prev by Date: Re: Coefficient
  • Next by Date: InverseFunction returning working function or just a symbol
  • Previous by thread: Re: Partition Help
  • Next by thread: Partition string into length n chunks