MathGroup Archive 2010

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

Search the Archive

Sorting paired columns of dates and values

  • To: mathgroup at
  • Subject: [mg106656] Sorting paired columns of dates and values
  • From: Garapata <warsaw95826 at>
  • Date: Wed, 20 Jan 2010 06:49:04 -0500 (EST)

I've imported a large flat file of dates and values in a structure
like this:

data = {{1/3/1984,997.5,1/5/1970,2402.85,1/2/1961,536.3},

The above example has 3 columns of dates.  Each date column has a
matching column of values immediately to its right.

As seen above, each of the date columns starts with a different date.

Not seen, each date and value paired column has a final value on the
same date: 12/31/2009.

I want to sort each of the date and value paired columns in a
descending order by its date column, so that my first row of data
would all have the 12/31/2009 date.  This should also line up all the
subsequent rows by descending dates, which would allow me to drop all
but one of the columns with dates and consolidate the list.

I've looked at Partition, Sort, and SortBy but can't see a direct way
to do this.

I'll keep trying through the night.  Any help much appreciated.

  • Prev by Date: Re: Replace list element based on a condition how to
  • Next by Date: Re: Re: Testing Mathematica Expressions?
  • Previous by thread: Re: StringCases matching on portions of sublist?
  • Next by thread: Re: Sorting paired columns of dates and values