Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #10126

Re: Partition Help

From Alexei Boulbitch <Alexei.Boulbitch@iee.lu>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Partition Help
Date 2012-05-18 09:26 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jp54jt$gnr$1@smc.vnet.net> (permalink)

Show all headers | View raw


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@iee.lu




Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Partition Help Alexei Boulbitch <Alexei.Boulbitch@iee.lu> - 2012-05-18 09:26 +0000

csiph-web