Re: Minimum and Maximum of a list containing floating point numbers

2010-09-07 Thread nn
On Sep 6, 10:31 pm, Steven D'Aprano wrote: > On Tue, 07 Sep 2010 11:00:45 +1000, Ben Finney wrote: > > If you're going to use the list of float objects, you can convert them > > all with a list comprehension. > [...] > >     >>> numbers_as_float = [float(x) for x in numbers_as_str] > > That's awfu

Re: Minimum and Maximum of a list containing floating point numbers

2010-09-07 Thread Xavier Ho
On 7 September 2010 10:56, MRAB wrote: > > > Incidentally, there's a builtin function called 'input' so using it as > a variable name is a discouraged! :-) Right-o! Cheers, Xav -- http://mail.python.org/mailman/listinfo/python-list

Re: Minimum and Maximum of a list containing floating point numbers

2010-09-06 Thread Ben Finney
Steven D'Aprano writes: > Of course, list comps are so seductively easy, and functional > programming so conceptually different from what many people are used > to, that such over-specification is an awfully easy trap to fall into. > I'm sure my own code is filled with similar examples where I us

Re: Minimum and Maximum of a list containing floating point numbers

2010-09-06 Thread Steven D'Aprano
On Tue, 07 Sep 2010 12:40:57 +1000, Ben Finney wrote: > Steven D'Aprano writes: > >> On Tue, 07 Sep 2010 11:00:45 +1000, Ben Finney wrote: >> >> > If you're going to use the list of float objects, you can convert >> > them all with a list comprehension. >> [...] >> > >>> numbers_as_float = [

Re: Minimum and Maximum of a list containing floating point numbers

2010-09-06 Thread Ben Finney
Steven D'Aprano writes: > On Tue, 07 Sep 2010 11:00:45 +1000, Ben Finney wrote: > > > If you're going to use the list of float objects, you can convert them > > all with a list comprehension. > [...] > > >>> numbers_as_float = [float(x) for x in numbers_as_str] > > That's awfully verbose. A m

Re: Minimum and Maximum of a list containing floating point numbers

2010-09-06 Thread Steven D'Aprano
On Tue, 07 Sep 2010 11:00:45 +1000, Ben Finney wrote: > If you're going to use the list of float objects, you can convert them > all with a list comprehension. [...] > >>> numbers_as_float = [float(x) for x in numbers_as_str] That's awfully verbose. A map is simpler: numbers_as_float = map(f

Re: Minimum and Maximum of a list containing floating point numbers

2010-09-06 Thread Ben Finney
ceycey writes: > I have a list like ['1.1881', '1.1881', '1.1881', '1.1881', '1.1881', > '1.1881', '1.1881', '1.1881', '1.1881', '1.1881', '1.7689', '1.7689', > '3.4225', '7.7284', '10.24', '9.0601', '9.0601', '9.0601', '9.0601', > '9.0601']. What I want to do is to find minimum and maximum num

Re: Minimum and Maximum of a list containing floating point numbers

2010-09-06 Thread Albert Hopkins
On Mon, 2010-09-06 at 17:37 -0700, ceycey wrote: > I have a list like ['1.1881', '1.1881', '1.1881', '1.1881', '1.1881', > '1.1881', '1.1881', '1.1881', '1.1881', '1.1881', '1.7689', '1.7689', > '3.4225', '7.7284', '10.24', '9.0601', '9.0601', '9.0601', '9.0601', > '9.0601']. What I want to do is

Re: Minimum and Maximum of a list containing floating point numbers

2010-09-06 Thread Tim Chase
On 09/06/10 19:37, ceycey wrote: I have a list like ['1.1881', '1.1881', '1.1881', '1.1881', '1.1881', '1.1881', '1.1881', '1.1881', '1.1881', '1.1881', '1.7689', '1.7689', '3.4225', '7.7284', '10.24', '9.0601', '9.0601', '9.0601', '9.0601', '9.0601']. What I want to do is to find minimum and m

Re: Minimum and Maximum of a list containing floating point numbers

2010-09-06 Thread MRAB
On 07/09/2010 01:44, Xavier Ho wrote: On 7 September 2010 10:37, ceycey mailto:cuneyt.er...@gmail.com>> wrote: I have a list like ['1.1881', '1.1881', '1.1881', '1.1881', '1.1881', '1.1881', '1.1881', '1.1881', '1.1881', '1.1881', '1.7689', '1.7689', '3.4225', '7.7284', '10.24', '9.0

Re: Minimum and Maximum of a list containing floating point numbers

2010-09-06 Thread Xavier Ho
On 7 September 2010 10:37, ceycey wrote: > I have a list like ['1.1881', '1.1881', '1.1881', '1.1881', '1.1881', > '1.1881', '1.1881', '1.1881', '1.1881', '1.1881', '1.7689', '1.7689', > '3.4225', '7.7284', '10.24', '9.0601', '9.0601', '9.0601', '9.0601', > '9.0601']. > How can I convert the

Minimum and Maximum of a list containing floating point numbers

2010-09-06 Thread ceycey
I have a list like ['1.1881', '1.1881', '1.1881', '1.1881', '1.1881', '1.1881', '1.1881', '1.1881', '1.1881', '1.1881', '1.7689', '1.7689', '3.4225', '7.7284', '10.24', '9.0601', '9.0601', '9.0601', '9.0601', '9.0601']. What I want to do is to find minimum and maximum number in this list. I used