On 20/02/24 01:04, Chris Green via Python-list wrote:
dn wrote:
On 18/02/24 09:53, Grant Edwards via Python-list wrote:
On 2024-02-17, Cameron Simpson via Python-list wrote:
On 16Feb2024 22:12, Chris Green wrote:
I'm looking for a simple way to make NaN values output as something
On 20/02/24 05:58, Grant Edwards via Python-list wrote:
Here's a demonstration of how to hook custom code into the f-string
formatting engine. It's brilliantly depraved.
https://stackoverflow.com/questions/55876683/hook-into-the-builtin-python-f-string-format-machinery
From the above:
Yo
On 2024-02-19, Chris Green via Python-list wrote:
> It's using f'{...}' at the moment.
Here's a demonstration of how to hook custom code into the f-string
formatting engine. It's brilliantly depraved.
https://stackoverflow.com/questions/55876683/hook-into-the-builtin-python-f-string-format-mach
Grant Edwards wrote:
> On 2024-02-16, Chris Green via Python-list wrote:
>
> > I'm looking for a simple way to make NaN values output as something
> > like '-' or even just a space instead of the string 'nan'.
>
> It would probably help if yo
dn wrote:
> On 18/02/24 09:53, Grant Edwards via Python-list wrote:
> > On 2024-02-17, Cameron Simpson via Python-list
> > wrote:
> >> On 16Feb2024 22:12, Chris Green wrote:
> >>> I'm looking for a simple way to make NaN values output as something
>
On 18/02/24 09:53, Grant Edwards via Python-list wrote:
On 2024-02-17, Cameron Simpson via Python-list wrote:
On 16Feb2024 22:12, Chris Green wrote:
I'm looking for a simple way to make NaN values output as something
like '-' or even just a space instead of
On Mon, 19 Feb 2024 at 06:47, Grant Edwards via Python-list
wrote:
> I would be tempted to try monkey-patching the float class to override
> the __format__ method. I have no idea what side effects that might
> have, or if it's even used by the various formatting mechanisms, so
> you might end up s
On 16/02/2024 23.12, Chris Green wrote:
I'm looking for a simple way to make NaN values output as something
like '-' or even just a space instead of the string 'nan'. This would
then make it much easier to handle outputting values from sensors when
not all sensors are
On 2024-02-16, Chris Green wrote:
> I'm looking for a simple way to make NaN values output as something
> like '-' or even just a space instead of the string 'nan'.
I tried monkey-patching the __format__ method of float, but it's
immutable, so that didnt
[I've been trying all afternoon to post via slrn, but nothing is
showing up on the list. Forgive me if multiple posts eventually show
up.]
On 2024-02-17, Cameron Simpson via Python-list wrote:
> On 16Feb2024 22:12, Chris Green wrote:
>>I'm looking for a simple way to make N
[Posts via slrn and my GMail account aren't showing up, so I guess I'll
try
subscribing from a different e-mail address.]
On 2024-02-17, Cameron Simpson via Python-list
wrote:
On 16Feb2024 22:12, Chris Green wrote:
I'm looking for a simple way to make NaN values output as
On 2024-02-17, Cameron Simpson via Python-list wrote:
> On 16Feb2024 22:12, Chris Green wrote:
>>I'm looking for a simple way to make NaN values output as something
>>like '-' or even just a space instead of the string 'nan'. [...]
>>
>>
On 2024-02-17, Cameron Simpson via Python-list wrote:
> On 16Feb2024 22:12, Chris Green wrote:
>>I'm looking for a simple way to make NaN values output as something
>>like '-' or even just a space instead of the string 'nan'. [...]
>>
>>
On 2024-02-17, Cameron Simpson via Python-list wrote:
> On 16Feb2024 22:12, Chris Green wrote:
>>I'm looking for a simple way to make NaN values output as something
>>like '-' or even just a space instead of the string 'nan'. [...]
>>
>>
On 2024-02-17, Cameron Simpson via Python-list wrote:
> On 16Feb2024 22:12, Chris Green wrote:
>>I'm looking for a simple way to make NaN values output as something
>>like '-' or even just a space instead of the string 'nan'.
>>[...]
>>
>&
On 2024-02-16, Chris Green via Python-list wrote:
> I'm looking for a simple way to make NaN values output as something
> like '-' or even just a space instead of the string 'nan'.
It would probably help if you told us how you're "outputting" them
On 16Feb2024 22:12, Chris Green wrote:
I'm looking for a simple way to make NaN values output as something
like '-' or even just a space instead of the string 'nan'. This would
then make it much easier to handle outputting values from sensors when
not all sensors are
I'm looking for a simple way to make NaN values output as something
like '-' or even just a space instead of the string 'nan'. This would
then make it much easier to handle outputting values from sensors when
not all sensors are present.
So, for example, my battery m
J Conrado wrote:
> I have a 2d array and I would how can I replace NaN values for example
> with - value or other value.
>>> a
array([[ nan, 1., 2., 3.],
[ 4., 5., 6., 7.],
[ 8., 9., 10., nan]])
>>> a[numpy.isnan(a)] = 42
>>>
Hi,
I have a 2d array and I would how can I replace NaN values for example
with - value or other value.
Thank,
Conrado
--
https://mail.python.org/mailman/listinfo/python-list
Hi i am trying to use chi-square Test to select most important columns among
5501 columns. But for most of the columns i am getting NAN value as a Chi test
value
import pandas as pd
from sklearn.preprocessing import LabelEncoder
from sklearn.feature_selection import chi2
cols =[]
cols.append
Greg,
Good eye. You are correct!
Yes, that is a side effect I did not intend when I cut and paste and the
darn spell-checker saw it as useful to make my code act like the start of a
normal text sentence. I just replicated it:
>>> float(" nan")
Nan
As I watched, "nan&qu
Avi Gross wrote:
I can see why you may be wondering. You see the nan concept as having a
specific spelling using all lowercase and to an extent you are right.
No, he's talking about this particular line from the transcript you
posted:
>>>float(" nan")
>
On Fri, Feb 15, 2019 at 4:15 PM Avi Gross wrote:
>
> > You shouldn't be testing floats for identity.
>
> I am not suggesting anyone compare floats. I repeat that a nan is not
> anything. Now as a technicality, it is considered a float by the type
> command as there is
Chris,
I don't wish to continue belaboring this topic but will answer you and then
ignore anything non-essential.
You said:
> You shouldn't be testing floats for identity.
I am not suggesting anyone compare floats. I repeat that a nan is not
anything. Now as a technicality, it is
On Fri, Feb 15, 2019 at 2:37 PM Avi Gross wrote:
> But here is a curiosity. The numpy add-on package has a nan that is UNIQUE
> so two copies are the same. Read this transcript and see if it might
> sometimes even be useful while perhaps confusing the heck out of people who
> assume
Grant,
I can see why you may be wondering. You see the nan concept as having a
specific spelling using all lowercase and to an extent you are right.
As I pointed out. In the context of a string to convert to a float, any
upper/lower-case spelling of NaN is accepted.
But, to answer you anyway, I
On 2019-02-14, Avi Gross wrote:
> I experimented a bit:
>
>>>> float("nan ")
> nan
>>>> float(" nan")
> Nan
>>>> float(" nAn")
> nan
That's curious. I've never seen "Nan" before. What versi
Other people have replied well enough with better ways to do this but I am
stuck on WHY this was seen as a way to do this at all.
The code was:
r = float('Nan')
while r==float('Nan'):
inp = input("Enter a number\n")
try:
r = float(inp)
Chris Angelico writes:
>
> Or even better, use None instead of nan. There's nothing in Python
> says you have to (ab)use a floating-point value as a signal. Or use
> "while True" and add a break if the exception isn't thrown.
Good point.
--
https://mail.python.org/mailman/listinfo/python-list
> Or even better, use None instead of nan.
++
On Thu, Feb 14, 2019 at 3:26 AM Joe Pfeiffer wrote:
> u...@speedy.net writes:
>
> > There are more integers than odd numbers, and more odd numbers than prime
> > numbers. An infinite set may be a subset of another infinite set
On Fri, Feb 15, 2019 at 3:56 AM Joe Pfeiffer wrote:
>
> ast writes:
>
> > Le 13/02/2019 à 14:21, ast a écrit :
> >> Hello
> >>
> >> >>> float('Nan') == float('Nan')
> >> False
> >>
> >> Why ?
>
ast writes:
> Le 13/02/2019 à 14:21, ast a écrit :
>> Hello
>>
>> >>> float('Nan') == float('Nan')
>> False
>>
>> Why ?
>>
>> Regards
>>
>
> Thank you for answers.
>
> If you wonder how I
Le 13/02/2019 à 14:21, ast a écrit :
Hello
>>> float('Nan') == float('Nan')
False
Why ?
Regards
Thank you for answers.
If you wonder how I was trapped with it, here
is the failing program.
r = float('Nan')
while r==float('Nan'):
i
u...@speedy.net writes:
> There are more integers than odd numbers, and more odd numbers than prime
> numbers. An infinite set may be a subset of another infinite set although
> they may both have the same cardinality. Or in other words, the number of
> elements in each set is not equal. One has m
songbird writes:
> Chris Angelico wrote:
>> On Thu, Feb 14, 2019 at 7:12 AM Test Bot wrote:
>>>
>>> This definition of NaN is much better in mentally visualizing all the so
>>> called bizarreness of IEEE. This also makes intuitive that no 2 NaN will be
>&g
On Thu, Feb 14, 2019 at 11:01 AM songbird wrote:
> all such proofs i have ever seen are based upon the
> assumptions that there are infinite numbers of such
> things like primes.
I posted an abbreviated proof of that in a footnote. It's a proof by
contradiction. First, assume that there are, in
Chris Angelico wrote:
> On Thu, Feb 14, 2019 at 7:12 AM Test Bot wrote:
>>
>> This definition of NaN is much better in mentally visualizing all the so
>> called bizarreness of IEEE. This also makes intuitive that no 2 NaN will be
>> equal just as no 2 infinities wou
On Thu, Feb 14, 2019 at 9:07 AM Avi Gross wrote:
> But that means that normal mathematics is warped.
Well yes. Yes, it is. That's why people think "Alice's Adventures
in Wonderland" is the result of a drug-induced dream - in actual fact,
it's the result of the Dean of Mathematics telling stor
I think we should realize that Nan and NA and so on are human constructs people
Define in programming languages. Some have subdivisions as in not an int as
compared to not a float.
Python also has an Inf as well as a -Inf that are abstractions and not a real,
so to speak. Number.
Mathematics
On Thu, Feb 14, 2019 at 8:24 AM אורי wrote:
> On Wed, Feb 13, 2019 at 10:20 PM Chris Angelico wrote:
>>
>> Why would no two infinities be equal? In mathematics, there's one
>> best-known infinity (aleph null, aka the number of counting numbers),
>> and many many infinities are provably equal
אורי
u...@speedy.net
On Wed, Feb 13, 2019 at 10:20 PM Chris Angelico wrote:
> On Thu, Feb 14, 2019 at 7:12 AM Test Bot wrote:
> >
> > This definition of NaN is much better in mentally visualizing all the so
> > called bizarreness of IEEE. This also makes intuitive th
On 2/13/19 12:32 PM, Marko Rauhamaa wrote:
"Avi Gross" :
A NaN is a bit like a black hole. Anything thrown in disappears and
that is about all we know about it. No two black holes are the same
even if they seem to have the same mass, spin and charge. All they
share is that we don
"Avi Gross" :
> A NaN is a bit like a black hole. Anything thrown in disappears and
> that is about all we know about it. No two black holes are the same
> even if they seem to have the same mass, spin and charge. All they
> share is that we don't know what is in them
On Thu, Feb 14, 2019 at 7:12 AM Test Bot wrote:
>
> This definition of NaN is much better in mentally visualizing all the so
> called bizarreness of IEEE. This also makes intuitive that no 2 NaN will be
> equal just as no 2 infinities would be equal. I believe in a hypothesis(of
>
This definition of NaN is much better in mentally visualizing all the so
called bizarreness of IEEE. This also makes intuitive that no 2 NaN will be
equal just as no 2 infinities would be equal. I believe in a hypothesis(of
my own creation) that any arithmetic on a data type of NaN would be
On 2/13/19 1:53 PM, Grant Edwards wrote:
Floating point is sort of the quantum mechanics of computer science.
At first glance, it seems sort of weird. But after you work with it a
while, it gets even worse.
Yep! :-)
--
https://mail.python.org/mailman/listinfo/python-list
On Thu, Feb 14, 2019 at 6:55 AM Grant Edwards wrote:
>
> On 2019-02-13, Schachner, Joseph wrote:
>
> > This makes some sense because NAN is Not A Number, so any comparison
> > to a number fails.
>
> Ah, but you now seem to be conflating "comparison fails" w
On Thu, Feb 14, 2019 at 6:40 AM Schachner, Joseph
wrote:
>
> Because all comparisons with NAN return false, that's the spec.
Apart from !=, because it would be insane (I mean, even more insane
than it is) to have nan == nan be false AND nan != nan.
IEEE NAN has several purposes
On 2019-02-13, Schachner, Joseph wrote:
> This makes some sense because NAN is Not A Number, so any comparison
> to a number fails.
Ah, but you now seem to be conflating "comparison fails" with
"comparison has a boolean value of False".
The alternative to (nan == nan
Because all comparisons with NAN return false, that's the spec. is NAN > 0?
False. Is NAN< 0? False. Is NAN == 0? False. Is NAN == ? False.
So: Is NAN == NAN? False. And one more: Is NAN < 1.0e18? False
This makes some sense because NAN is Not A Number, so any compariso
ast writes:
> Hello
>
>>>> float('Nan') == float('Nan')
> False
>
> Why ?
>
> Regards
Others have given the real answer -- IEEE says so, and the people who
wrote the standard are smarter than me. All the same, this is my take
on the rea
I won't speak for the IEEE but NOT A NUMBER does not tell you what something
IS.
If "Hello, World!" is not a number as in an int or a float and we throw away
the content and simply call it a NaN or something and then we notice that an
object that is a list of fruits is also not
On 2019-02-13, ast wrote:
> Hello
>
> >>> float('Nan') == float('Nan')
> False
If you think that's odd, how about this?
>>> n = float('nan')
>>> n
nan
>>> n is n
True
>>> n ==
On 2/13/19 7:21 AM, ast wrote:
Hello
>>> float('Nan') == float('Nan')
False
Why ?
Because the IEEE-754 Standard demands it, and people smarter
than I worked on the IEEE-754 Standard.
<https://en.wikipedia.org/wiki/NaN> is a quick starting
point for a deep
Hello
>>> float('Nan') == float('Nan')
False
Why ?
Regards
--
https://mail.python.org/mailman/listinfo/python-list
issue but there are no NaN,
infinites, negative infinites or large values.
I tried to answer it probably because it looked fishy and some people
need encouragement to read the fine manual. I don't know for sure, you
trimmed all the attribution and I can't find a thread of this name
> You may be using the sklearn package incorrectly; you'll
> have to read the (apparently quite prolific) documentation yourself,
> I've never used it.
>
> --
> Rhodri James *-* Kynesim Ltd
So why would you try to answer it? I have the same issue but there are
I'm trying to take the min and max of a couple Pandas Series objects in the
face of NaT. np.minimum and np.maximum work the way I want if the elements
are floats. For example:
>>> s1
00.0
11.8
23.6
35.4
dtype: float64
>>> s2
0 10.0
117.0
2 NaN
3
uot;, line
407, in check_array
_assert_all_finite(array)
File "/.local/lib/python2.7/site-packages/sklearn/utils/validation.py", line
58, in _assert_all_finite
" or a value too large for %r." % X.dtype)
ValueError: Input contains NaN, infinity or a value too large
array
_assert_all_finite(array)
File "/.local/lib/python2.7/site-packages/sklearn/utils/validation.py", line
58, in _assert_all_finite
" or a value too large for %r." % X.dtype)
ValueError: Input contains NaN, infinity or a value too large for
dtype('float32
File "/.local/lib/python2.7/site-packages/sklearn/utils/validation.py", line
58, in _assert_all_finite
" or a value too large for %r." % X.dtype)
ValueError: Input contains NaN, infinity or a value too large for
dtype('float32').
Process finished with exit code 1
Description :
Can any one help with the error message.
--
https://mail.python.org/mailman/listinfo/python-list
ontainer types use a
> >> >> hybrid test: "a is b or a == b".
> >> >>
> >> >> My question is, is this a *correct* implementation of the operator, or
> >> >> are objects "supposed to" use a basis of equality for these t
ver, the
>> >> contains operation does not specify whether object identity or
>> >> equality is to be used. In effect, the built-in container types use a
>> >> hybrid test: "a is b or a == b".
>> >>
>> >> My question is,
e me a little fuller (if not more realistic) example
> [Your xx and yy are what?]
xx and yy are lists of floats, and for your test xx should have at least one
zero in it.
> And I have to see if I know how to tweak it nan-less
> And at least maintain hopefully improve the clarity, succi
mpression (maybe I am wrong):
> > "Catch an exception and ignore it" is a way of converting signalling to
> > quiet With the added advantage of being able to tweak the specs of what
> > happens when nan op normal to one's taste
>
>
> I don't understand
w_name point to old implementation
To make bar == baz we need more and more heavy-duty theorem provers
And will invariably hit halting-problem in some guise or other
>
> Also, I have no idea what any of this has to do with nans and
> container membership.
⊥ in semantics is the prototypica
On Sat, Mar 7, 2015 at 4:04 AM, Rustom Mody wrote:
> You dont grok your theory of computation very well do you?
>
> def foo(x): return x + x
> def bar(x): return x + x
> def baz(x): return 2*x
>
> One can imagine an implementation where
> id(foo) == id(bar)
> [I am assuming that id is a good enoug
v/2014-July/135476.html
>
> If it is a bug for NaN to "infect" containers' behavior, we need to take
> a serious look at sort().
Hmmm. No, I don't think so. I think that NANs are just weird and you either
accept that they do weird things or you don't use them.
Re
ify whether object identity or equality
> >> is to be used. In effect, the built-in container types use a hybrid
> >> test: "a is b or a == b".
> >>
> >> My question is, is this a *correct* implementation of the operator, or
> >> are objects
ded advantage of being able to tweak the specs of what
> happens when nan op normal to one's taste
I don't understand what you are trying to say.
Let's take a dirt-simple example:
def inverse(x):
return 1.0/x
There's an exception there, waiting to bite. If I include i
> test: "a is b or a == b".
>>
>> My question is, is this a *correct* implementation of the operator, or
>> are objects "supposed to" use a basis of equality for these tests?
>
> nan is an illegal or bogus value.
NANs *represent* bogus values, they
On 2015-03-06, Chris Angelico wrote:
> On Fri, Mar 6, 2015 at 8:50 PM, Rustom Mody wrote:
>> In a language like python with decent exceptions we do not need nans.
>
> Not so. I could perhaps accept that we don't need signalling NaNs, as
> they can be replaced with exceptions, but quiet NaNs are b
t; they can be replaced with exceptions, but quiet NaNs are by definition
> _not_ exceptions.
My impression (maybe I am wrong):
"Catch an exception and ignore it" is a way of converting signalling to quiet
With the added advantage of being able to tweak the specs of what happens when
na
On Fri, Mar 6, 2015 at 8:50 PM, Rustom Mody wrote:
> In a language like python with decent exceptions we do not need nans.
Not so. I could perhaps accept that we don't need signalling NaNs, as
they can be replaced with exceptions, but quiet NaNs are by definition
_not_ exceptions.
ChrisA
--
htt
estion is, is this a *correct* implementation of the operator, or
> are objects "supposed to" use a basis of equality for these tests?
nan is an illegal or bogus value.
As usual legalizing the illegal is always fraught with increasing conundrums.
The most (to me) classic instance of thi
.html
If it is a bug for NaN to "infect" containers' behavior, we need to take
a serious look at sort().
I entirely agree. With the extremely serious bug that was reported (and
fixed) just a few days ago in the Python sorting algorithm and/or code,
it is quite clear to me
On Thu, Mar 5, 2015, at 22:49, Chris Angelico wrote:
> I'm not sure it's just an optimization. Compare this post from
> python-dev, where Nick Coghlan discusses the same topic:
>
> https://mail.python.org/pipermail/python-dev/2014-July/135476.html
If it is a bug for NaN
On Fri, Mar 6, 2015 at 2:26 PM, Ben Finney wrote:
> Isn't the point at issue that the Python interpreter *may* optimise by
> assuming ‘is implies equality’, so the ‘in’ operator can fail if that
> assumption is false?
>
> I thought the problem was that types with custom behaviour, as with the
> ‘N
re? Because True is current behavior.
>
> Isn't the point at issue that the Python interpreter *may* optimise by
> assuming ‘is implies equality’, so the ‘in’ operator can fail if that
> assumption is false?
No, it's not a /may/, it's a /does/, and that it can be
Ethan Furman writes:
> On 03/05/2015 06:55 PM, Ben Finney wrote:
>
> > class NullType(object):
> > """ A type whose value never equals any other.
> >
> > This type's values will behave correctly when tested for
> > membership in a collection::
> >
> >
On 03/05/2015 06:55 PM, Ben Finney wrote:
> class NullType(object):
> """ A type whose value never equals any other.
>
> This type's values will behave correctly when tested for
> membership in a collection::
>
> >>> foo = NullType()
>
Steven D'Aprano writes:
> Since reflexivity is *almost* universal, and using object identity
> permits very substantial optimizations, the core developers agreed
> that built-in contain types may assume that `x is y` implies `x == y`.
> Users of NANs and other non-reflexive types can subclass or
random...@fastmail.us wrote:
> It's been brought up on Stack Overflow that the "in" operator (on
> tuples, and by my testing on dict and list, as well as dict lookup) uses
> object identity as a shortcut, and returns true immediately if the
> object being tested *is* an element of the container. H
Nothing about nans is 'correct'. They are a CS invention
On 3/5/2015 5:26 PM, random...@fastmail.us wrote:
It's been brought up on Stack Overflow that the "in" operator (on
tuples, and by my testing on dict and list, as well as dict lookup) uses
object identity as a shortcut, and returns true i
On Fri, Mar 6, 2015 at 10:27 AM, wrote:
> Do you have an example of where `a is b` but `a != b` in Python? `None ==
> None` is True.
Check out the subject line.
>>> nan = float("nan")
>>> nan is nan # obviously
True
>>> nan != nan
b` in Python?
Maybe I misunderstand your question, but you've already been discussing
such an example. Here it is for clarity::
>>> nan = float("NaN")
>>> (nan is nan) == (nan == nan)
False
>>> nan is nan
True
>>> nan == nan
On Thursday, March 5, 2015 at 3:20:16 PM UTC-8, Ben Finney wrote:
> sohcahto...@gmail.com writes:
>
> > I would argue that if `a is b` then it is obvious that `a == b`
>
> It may be obvious, but it's not necessarily true. Some commonly-used
> values - for example, an "null" - are not equal to the
On Fri, Mar 6, 2015 at 10:11 AM, wrote:
> I would argue that if `a is b` then it is obvious that `a == b`
This is not true for float("nan"), though. The question is, is your
above statement a valid optimization for the 'in' operator, or not?
And no, it isn't, bec
sohcahto...@gmail.com writes:
> I would argue that if `a is b` then it is obvious that `a == b`
It may be obvious, but it's not necessarily true. Some commonly-used
values – for example, an “null” – are not equal to themselves, by
definition.
It is fine to define such a type in Python, because ‘
On Thursday, March 5, 2015 at 2:27:12 PM UTC-8, rand...@fastmail.us wrote:
> It's been brought up on Stack Overflow that the "in" operator (on
> tuples, and by my testing on dict and list, as well as dict lookup) uses
> object identity as a shortcut, and returns true immediately if the
> object bei
It's been brought up on Stack Overflow that the "in" operator (on
tuples, and by my testing on dict and list, as well as dict lookup) uses
object identity as a shortcut, and returns true immediately if the
object being tested *is* an element of the container. However, the
contains operation does no
On Fri, Jan 9, 2015 at 1:12 PM, Ian Kelly wrote:
> Or to never have to worry about it:
>
> INF = 1e400
> while not math.isinf(INF):
> INF *= INF
With no imports whatsoever:
inf = 1e400
nan = inf-inf
while nan == nan:
inf *= inf
nan = inf-inf
But now we're getti
On Thu, Jan 8, 2015 at 7:07 PM, Chris Angelico wrote:
> On Fri, Jan 9, 2015 at 12:46 PM, Steven D'Aprano
>> The fallback rule I use when float('nan') fails is
>>
>> INF = 1e3000 # Hopefully, this should overflow to INF.
>> NAN = INF-INF # A
On Fri, Jan 9, 2015 at 12:46 PM, Steven D'Aprano
wrote:
> Chris Angelico wrote:
>
>> On Fri, Jan 9, 2015 at 1:50 AM, Jussi Piitulainen
>> wrote:
>>>>>> 0*1e400
>>>nan
>>
>> Nice, that's shorter than mine.
>
&
Chris Angelico wrote:
> On Fri, Jan 9, 2015 at 1:50 AM, Jussi Piitulainen
> wrote:
>>>>> 0*1e400
>>nan
>
> Nice, that's shorter than mine.
o_O
Is that really the sort of thing you should be revealing here?
Oh wait, you're talking about co
Chris Angelico writes:
> On Fri, Jan 9, 2015 at 1:37 AM, Marko Rauhamaa wrote:
> >
> > True, but that got me thinking: what standard Python math
> > operation evaluates to NaN?
>
> Subtracting infinity from infinity is one easy way.
>
> >>> 1e309
>
On Fri, Jan 9, 2015 at 1:50 AM, Jussi Piitulainen
wrote:
>>>> 0*1e400
>nan
Nice, that's shorter than mine.
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
Marko Rauhamaa writes:
> Ian Kelly:
>
> > To get nan as a literal just do:
> >
> > nan = float("nan")
>
> True, but that got me thinking: what standard Python math operation
> evaluates to NaN?
All manner of arithmetics gives overflow errors (&qu
On Fri, Jan 9, 2015 at 1:37 AM, Marko Rauhamaa wrote:
> Ian Kelly :
>
>> To get nan as a literal just do:
>>
>> nan = float("nan")
>
> True, but that got me thinking: what standard Python math operation
> evaluates to NaN?
Subtracting infinity fr
1 - 100 of 493 matches
Mail list logo