sorting items in a table problematic because of scientific notation
Davis, Amelie Y
aydavis at purdue.edu
Tue May 5 02:45:25 CEST 2009
Thank you _ that solved it.
Please consider the environment before printing this e-mail or any of its attachments (if applicable)
From: python-list-bounces+aydavis=purdue.edu at python.org [mailto:python-list-bounces+aydavis=purdue.edu at python.org] On Behalf Of Raymond Hettinger
Sent: Wednesday, April 29, 2009 10:31 AM
To: python-list at python.org
Subject: Re: sorting items in a table problematic because of scientific notation
> > 'NEAR_DIST'], [('N', 9, 0), ('N', 9, 0), ('F', 19, 11)], [53, 55, '
> The data type code for the offending column is "F" which is not in the
> bog-standard dBase III set of C, N, D, and L. The code that you have used merely
> returns unchanged the character string that finds in the data base.
> > 1.05646365517e+005'], [53, 6, ' 9.32599134016e+004'], [53, 0, '
> > 8.97477154418e+004'], [53, 2, ' 8.96449127749e+004'], [53, 1, '
> > 7.88170078501e+004'], [53, 5, ' 8.29281503631e+004'], [53, 4, '
FWIW, I just updated the recipe to handle an F typecode
by casting it to a float. Hope this helps.
More information about the Python-list