Minimum and Maximum of a list containing floating point numbers
Steven D'Aprano
steve-REMOVE-THIS at cybersource.com.au
Mon Sep 6 22:31:17 EDT 2010
More information about the Python-list mailing list
Mon Sep 6 22:31:17 EDT 2010
- Previous message (by thread): Minimum and Maximum of a list containing floating point numbers
- Next message (by thread): Minimum and Maximum of a list containing floating point numbers
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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(float, numbers_as_str) -- Steven
- Previous message (by thread): Minimum and Maximum of a list containing floating point numbers
- Next message (by thread): Minimum and Maximum of a list containing floating point numbers
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list