Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2010

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

Search the Archive

Need to align data from sublists to Union of dates from all sublists

  • To: mathgroup at
  • Subject: [mg111155] Need to align data from sublists to Union of dates from all sublists
  • From: Garapata <warsaw95826 at>
  • Date: Thu, 22 Jul 2010 05:42:18 -0400 (EDT)

Hi everyone,

A simple example of my problem follows.

I have a nested list, myList, with the following dimensions:

     Dimensions[#] & /@ myList

     {{93, 2}, {93, 2}, {93, 2}, {88, 2}, {92, 2}, {93, 2}, {93, 2}}

The columns of each sublist contain values and SQLDateTime(s)
respectively, i.e:

=E2=80=A8      {1.01055, SQLDateTime[{2010, 7, 9, 10, 30, 0.}]

I've sorted each sublist by SQLDateTime.

The Union of the date columns across all sub lists give me 120
distinct dates.

     myUnion = Union @@ (myList[[All, All, 2]]);


That's what I have so far.

Now I need to do 2 things:

First, create a 2 dimensional list with dimensions {120, 7} that would
have myUnion as the first column and the seven columns of values from
the sublists in myList aligned with their respective dates in
myUnion.  This will leave me with some blanks throughout the matrix
which I need to fill in with the value 1.

Just not sure how to do it.

Please advise.

Many thanks

  • Prev by Date: Re: Brillouin function for a Ferromagnet
  • Next by Date: Code highlighting
  • Previous by thread: Re: Very very basic question about Mathematica
  • Next by thread: Code highlighting