On Tue, Jun 23, 2009 at 1:53 AM, Alan Gauld wrote:
> Interesting! How is a NaN stored in Python?
> ie. How do you get to the point of having one in the first place?
Google 'python nan' for lots of interesting discussion...
Kent
___
Tutor maillist - Tu
2009/6/23 Alan Gauld :
> Interesting! How is a NaN stored in Python?
> ie. How do you get to the point of having one in the first place?
Well, you can do this:
>>> float('nan')
nan
(try float('inf') too)
--
John.
___
Tutor maillist - Tutor@python.o
"Kent Johnson" wrote
I have a list with some values being NaN (after division-by-zero). How
can I
check and remove all the NaN values?
In Python 2.6 you can use math.isnan() to check for NaN, so you can
filter your list by
newList = [ x for x in oldList if not math.isnan(x) ]
Interesting!
On Mon, Jun 22, 2009 at 4:15 PM, Elisha Rosensweig wrote:
> Hi,
>
> I have a list with some values being NaN (after division-by-zero). How can I
> check and remove all the NaN values?
In Python 2.6 you can use math.isnan() to check for NaN, so you can
filter your list by
newList = [ x for x in old
"Elisha Rosensweig" wrote
I have a list with some values being NaN (after division-by-zero). How
can I
check and remove all the NaN values?
NaN is, so far as I know, a JavaScript only feature. The equivalent thing
in Python would be to avoid having those 'values' in your list in the first
p
Hi,
I have a list with some values being NaN (after division-by-zero). How can I
check and remove all the NaN values?
Thanks
Elisha
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor