On 2022-12-19 16:14, MRAB wrote:
To be fair, I don't think I've never seen that notation either! I've
only ever seen the form 6.67430E-11 ± 0.00015E-11, which is much clearer.
We use it regularly in our experimental data: 6.3(4), 15.002(10). Things
would become complex using exponential forms
point of using Decimal if you start with nothing more than
float accuracy?
Right. He also interpreted the notation "6.67430(15)E-11" wrong. The
digits in parentheses represent the uncertainty in the same number of
last digits. So "6.67430(15)E-11" means "something between 6.
On 17/12/2022 18:55, Stefan Ram wrote:
> Grant Edwards writes:
>> Yes, fixed point (or decimal) is a better fit for what he's doing. but
>> I suspect that floating point would be a better fit for the problem
>> he's trying to solve.
>
> I'd like to predict that within the next ten posts in this
On 19/12/22 9:24 am, Stefan Ram wrote:
So what's the time until a mass of one gram
arrives at the ground versus a mass of ten grams? I think
one needs "Decimal" to calculate this!
Or you can be smarter about how you calculate it.
Differentiating t with respect to m gives
dt/dm = -0.5 * sqr
On 2022-12-19 15:14:14 +, MRAB wrote:
> On 2022-12-19 14:10, Peter J. Holzer wrote:
> > He also interpreted the notation "6.67430(15)E-11" wrong. The
> > digits in parentheses represent the uncertainty in the same number of
> > last digits. So "6.67430(15)E-11" means "something between 6.67430E
h nothing more than
float accuracy?
Right. He also interpreted the notation "6.67430(15)E-11" wrong. The
digits in parentheses represent the uncertainty in the same number of
last digits. So "6.67430(15)E-11" means "something between 6.67430E-11 -
0.00015E-11 and 6.67430E-11
more than
float accuracy?
Right. He also interpreted the notation "6.67430(15)E-11" wrong. The
digits in parentheses represent the uncertainty in the same number of
last digits. So "6.67430(15)E-11" means "something between 6.67430E-11 -
0.00015E-11 and 6.67430E-11 + 0.0001
On 2022-12-19 09:25:17 +1100, Chris Angelico wrote:
> On Mon, 19 Dec 2022 at 07:57, Stefan Ram wrote:
> > G = Decimal( 6.6743015E-11 )
> > r = Decimal( 6.371E6 )
> > M = Decimal( 5.9722E24 )
>
> What's the point of using Decimal if you start with nothing more t
On 19Dec2022 08:53, Cameron Simpson wrote:
I'm no expert on floating point coding for precision, but I believe
that trying to work with values "close together" in magnitude is
important because values of different scales inherently convert one of
them to the other scale (i.e. similar sized exp
aware of what goes on under the bonnet.
When you convert a string to a float, you're already getting the closest
possible value in binary floating point.
For things like physics simulations, you need to design your algorithms
so that they're tolerant of small inaccuracies in the represe
On Mon, 19 Dec 2022 at 07:57, Stefan Ram wrote:
> G = Decimal( 6.6743015E-11 )
> r = Decimal( 6.371E6 )
> M = Decimal( 5.9722E24 )
What's the point of using Decimal if you start with nothing more than
float accuracy?
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
places, but I would like
to be in control of or fully aware of what goes on under the bonnet.
First the short take: your machine pobably is quite precise, and float
is far more performant that the other numeric types available. Your
source data seem to have more round off than the rounding in a
On 18/12/2022 10.55, Stefan Ram wrote:
Grant Edwards writes:
Yes, fixed point (or decimal) is a better fit for what he's doing. but
I suspect that floating point would be a better fit for the problem
he's trying to solve.
I'd like to predict that within the next ten posts in this
thread
oach would not have helped you, because each of those
calculations would be done as floating point, and you wouldn't have
gotten any more precision (and maybe less) than simply doing
float('64550.727').
Here is a small but interesting discussion thread about float vs Decimal:
https:/
On Sun, 18 Dec 2022 11:14:28 -0500, Dennis Lee Bieber wrote:
> .. And maybe lament the days when a 3-digit result was acceptable in
> math class -- being the typical capability in reading a standard (10"
> scale) slide rule.
Arguably more thought was given to what those three digits meant in the
have helped you, because each of those
calculations would be done as floating point, and you wouldn't have
gotten any more precision (and maybe less) than simply doing
float('64550.727').
Here is a small but interesting discussion thread about float vs Decimal:
https://stackoverflow.co
* 0.1) + (2 * 0.01) + (7 * 0.001)
>
> Now I do not need to!
And that approach would not have helped you, because each of those
calculations would be done as floating point, and you wouldn't have
gotten any more precision (and maybe less) than simply doing
float('64550.727').
H
: python-list@python.org
Subject: Re: String to Float, without introducing errors
On 12/17/22 07:15, Thomas Passin wrote:
> You have strings, and you want to end up with numbers. The numbers
> are not integers. Other responders have gone directly to whether you
> should use float or decim
On Sun, 18 Dec 2022 at 09:46, Stefan Ram wrote:
>
> Grant Edwards writes:
> >Yes, fixed point (or decimal) is a better fit for what he's doing. but
> >I suspect that floating point would be a better fit for the problem
> >he's trying to solve.
>
> I'd like to predict that within the next ten po
numbers in my code, I want to change the Strings to Float type because
the code will not work with Strings but I do not want to change the
numbers in any other way.
s = "-64550.727"
f = float(s)
f
-64550.727
type(f)
(Contrary to the other people posting in this thread I don't
imply doing
float('64550.727').
Here is a small but interesting discussion thread about float vs Decimal:
https://stackoverflow.com/questions/32053647/comparing-python-decimals-created-from-float-and-string
Would you mind telling us why that degree of precision (that is, decimal
vs
On 2022-12-17 21:45:06 +0100, Paul St George wrote:
> It was the rounding rounding error that I needed to avoid (as Peter J.
> Holzer suggested). The use of decimal solved it and just in time. I
> was about to truncate the number, get each of the characters from the
> string mantissa, and then do s
On Sun, 18 Dec 2022 at 08:22, Grant Edwards wrote:
>
> On 2022-12-17, Chris Angelico wrote:
>
> >> It was the rounding rounding error that I needed to avoid (as Peter
> >> J. Holzer suggested). The use of decimal solved it and just in
> >> time. I was about to truncate the number, get each of the
On 2022-12-17, Chris Angelico wrote:
>> It was the rounding rounding error that I needed to avoid (as Peter
>> J. Holzer suggested). The use of decimal solved it and just in
>> time. I was about to truncate the number, get each of the
>> characters from the string mantissa, and then do something
On Sun, 18 Dec 2022 at 07:46, Paul St George wrote:
>
> Thanks to all!
> It was the rounding rounding error that I needed to avoid (as Peter J. Holzer
> suggested). The use of decimal solved it and just in time. I was about to
> truncate the number, get each of the characters from the string man
0.727
>> -64511.489
>> -64393.637
>> -64196.763
>> -63920.2
>
>> When I bring the numbers into my code, they are Strings. To use the
>> numbers in my code, I want to change the Strings to Float type
>> because the code will not work with Strings
On 12/17/2022 1:41 PM, Mats Wichmann wrote:
On 12/17/22 07:15, Thomas Passin wrote:
You have strings, and you want to end up with numbers. The numbers
are not integers. Other responders have gone directly to whether you
should use float or decimal as the conversion, but that is a secondary
On 12/17/22 07:15, Thomas Passin wrote:
You have strings, and you want to end up with numbers. The numbers are
not integers. Other responders have gone directly to whether you should
use float or decimal as the conversion, but that is a secondary matter.
If you have integers, convert with
You have strings, and you want to end up with numbers. The numbers are
not integers. Other responders have gone directly to whether you should
use float or decimal as the conversion, but that is a secondary matter.
If you have integers, convert with
integer = int(number_string)
If you
mbers in my code, I want to change the Strings to Float type because
> the code will not work with Strings but I do not want to change the
> numbers in any other way.
>>> s = "-64550.727"
>>> f = float(s)
>>> f
-64550.727
>>> type(f)
(Contrary to th
he
> numbers in my code, I want to change the Strings to Float type
> because the code will not work with Strings but I do not want
> to change the numbers in any other way.
That may be impossible. Float type is not exact and the conversion
will be the closest binary representation of
https://docs.python.org/3/library/decimal.html
Get Outlook for iOS<https://aka.ms/o0ukef>
From: Python-list on
behalf of Paul St George
Sent: Saturday, December 17, 2022 6:51:17 AM
To: python-list@python.org
Subject: String to Float, without introducing
in
my code, I want to change the Strings to Float type because the code will not
work with Strings but I do not want to change the numbers in any other way.
So, I want my Strings (above) to be these numbers.
-64550.727
-64511.489
-64393.637
-64196.763
-63920.2
-63563.037
-63124.156
-62602.254
On 26/08/2020 12:02, Peter J. Holzer wrote:
On 2020-08-26 22:40:36 +1200, dn via Python-list wrote:
On 26/08/2020 19:58, Joel Goldstick wrote:
[...]
<<< Code NB Python v3.8 >>>
def fp_range( start:float, stop:float, step:float=1.0 )->float:
""&quo
On 8/26/2020 6:40 AM, dn via Python-list wrote:
def fp_range( start:float, stop:float, step:float=1.0 )->float:
"""Generate a range of floating-point numbers."""
if stop <= start:
raise OverflowError( "RangeError: start must be less
On 8/25/20 10:39 PM, ADITYA wrote:
>Dear Sir/Ma’am
>
>I am requesting you to satisfy me about float number in Range function,
>because in the argument of range we can take integer but not double or
>float whenever double as well as float are integer in nature but w
On 2020-08-26 22:40:36 +1200, dn via Python-list wrote:
> On 26/08/2020 19:58, Joel Goldstick wrote:
> > On Wed, Aug 26, 2020 at 3:43 AM ADITYA wrote:
> > > Dear Sir/Ma’am
> > >
> > > I am requesting you to satisfy me about float number in Rang
On 26/08/2020 19:58, Joel Goldstick wrote:
On Wed, Aug 26, 2020 at 3:43 AM ADITYA wrote:
Dear Sir/Ma’am
I am requesting you to satisfy me about float number in Range function,
because in the argument of range we can take integer but not double or
float whenever double as well
On Wed, Aug 26, 2020 at 3:43 AM ADITYA wrote:
>
>Dear Sir/Ma’am
>
>I am requesting you to satisfy me about float number in Range function,
>because in the argument of range we can take integer but not double or
>float whenever double as well as float are integer
Dear Sir/Ma’am
I am requesting you to satisfy me about float number in Range function,
because in the argument of range we can take integer but not double or
float whenever double as well as float are integer in nature but when we
use double/float in, it gives error that- “'
On 6/11/2019 1:04 PM, Rob Gaddi wrote:
On 6/11/19 9:52 AM, madhavanbom...@gmail.com wrote:
I wrote the following lines of code:
xm = np.nanmean(x[indx],axis=None,dtype=float)
xsd = np.nanstd(x[indx],axis=None,dtype=float)
type(xm) # np.float64
type(xsd # np.float64
print(xm
On 6/11/19 9:52 AM, madhavanbom...@gmail.com wrote:
I wrote the following lines of code:
xm = np.nanmean(x[indx],axis=None,dtype=float)
xsd = np.nanstd(x[indx],axis=None,dtype=float)
type(xm)# np.float64
type(xsd# np.float64
print(xm) # 0.5414720812182742
print(xsd
I wrote the following lines of code:
xm = np.nanmean(x[indx],axis=None,dtype=float)
xsd = np.nanstd(x[indx],axis=None,dtype=float)
type(xm)# np.float64
type(xsd# np.float64
print(xm) # 0.5414720812182742
print(xsd) # 0.15748041033663002
print(str("{6.5f}"
> 27.1019 26.9223 26.7426 26.5630 26.3834 26.2037 26.0241
> 25.8445 25.6649 25.4852 25.3056 25.1260 24.9463 24.7667 24.5871
> 24.4075 24.2278 24.0482 -0.2616 -0.3215 -0.3813 -0.4412\n']
>
> Can anyone help me split as a float array?
7.1019 26.9223 26.7426 26.5630 26.3834 26.2037
> 26.0241 25.8445 25.6649 25.4852 25.3056 25.1260 24.9463
> 24.7667 24.5871 24.4075 24.2278 24.0482 -0.2616 -0.3215
> -0.3813 -0.4412\n']
>
> Can anyone help me split as a float array?
>
.4852 25.3056 25.1260 24.9463 24.7667 24.5871 24.4075
24.2278 24.0482 -0.2616 -0.3215 -0.3813 -0.4412\n']
Can anyone help me split as a float array?
Thanks in advance
--
https://mail.python.org/mailman/listinfo/python-list
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
considered a float by the type
command as there is no easy way to make an int that is a nan:
Here are multiple ways to make a nan:
>>> f = float("nan")
>>> type(f)
Oddly you can make a complex nan, sort of:
>>> c = complex("nan")
>>> c
(n
all nans are the same, or is it all nans are different?
>
> >>> floata = float('nan')
> >>> floatb = float('nan')
> >>> floata, floatb
> (nan, nan)
> >>> floata == floatb
> False
> >>> floata is floatb
>
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 although
> > they may
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
>>> equal just as no 2 infinities would be
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 would be equal. I believe in a hypo
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
ther one has more elements
than the first one. So the number of elements in two infinite sets can't be
equal. Even, if you compare the same set to itself.
>
> >>> float("inf") == float("inf")
> True
>
> NaN and infinity are quite different concepts, an
x27;t know what is in them.
Then, how do you explain:
>>> float("nan") != float("nan")
True
Why's that not False?
Marko
Because IEEE-754 decided that it was non-optional that (x != y) was
equal to not (x == y). Which is not the case for the
.
Then, how do you explain:
>>> float("nan") != float("nan")
True
Why's that not False?
Marko
--
https://mail.python.org/mailman/listinfo/python-list
size of the set of odd numbers" [1]. And
both Python and IEEE agree:
>>> float("inf") == float("inf")
True
NaN and infinity are quite different concepts, and they behave very differently.
ChrisA
[1] I'm sure someone will point out something pedantica
similar
to any set of operations on the set of Infinities.
On Thu, Feb 14, 2019, 12:33 AM Avi Gross 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
>
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" with
> "comparison has a boolean value of
a nullable column (say, taking the sum or average
of the values in a field), you just ignore any rows that are NULL; but
if *every* value is NULL, the sum is not 0, but NULL.
Now try mapping SQL's NULL to Python's float("nan"), and performing
operations on both sides.
Endless fun.
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
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) => False is probably not (
n to a
number fails.
--- Joseph S.
-Original Message-
From: ast
Sent: Wednesday, February 13, 2019 8:21 AM
To: python-list@python.org
Subject: Why float('Nan') == float('Nan') is False
Hello
>>> float('Nan') == float('Nan')
False
Why ?
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
Thank you all for various ways of finding the indices.
--
https://mail.python.org/mailman/listinfo/python-list
and consider which way to do it and then use
reasonable tools. If you really want the index so you can use it later in
various indexing ways, great. But if you just want to hold multiple items
together by an index, consider other choices including some of the above.
-Original Message-----
Fr
On 2019-01-10 17:05, Madhavan Bomidi wrote:
Sorry for re-posting with a correction.
I have an array (numpy.ndarray) with shape (1500L,) as below:
x = array([ 3.e+01, 6.e+01, 9.e+01, ...,
4.4940e+04, 4.4970e+04, 4.5000e+04])
Now, I
On 1/10/19 9:25 AM, Peter Otten wrote:
Madhavan Bomidi wrote:
I have an array (numpy.ndarray) with shape (1500L,) as below:
x = array([ 3.e+01, 6.e+01, 9.e+01, ...,
4.4940e+04, 4.4970e+04, 4.5000e+04])
Now, I wanted to determine the indic
Madhavan Bomidi wrote:
> I have an array (numpy.ndarray) with shape (1500L,) as below:
>
> x = array([ 3.e+01, 6.e+01, 9.e+01, ...,
> 4.4940e+04, 4.4970e+04, 4.5000e+04])
>
> Now, I wanted to determine the indices of the x values between 0.0
PM
To: python-list@python.org
Subject: Re: How can I find the indices of an array with float values in python?
Sorry for re-posting with a correction.
I have an array (numpy.ndarray) with shape (1500L,) as below:
x = array([ 3.e+01, 6.e+01, 9.e+01, ...,
4.494000
Sorry for re-posting with a correction.
I have an array (numpy.ndarray) with shape (1500L,) as below:
x = array([ 3.e+01, 6.e+01, 9.e+01, ...,
4.4940e+04, 4.4970e+04, 4.5000e+04])
Now, I wanted to determine the indices of the x values bet
I have an array (numpy.ndarray) with shape (1500L,) as below:
x = array([ 3.e+01, 6.e+01, 9.e+01, ...,
4.4940e+04, 4.4970e+04, 4.5000e+04])
Now, I wanted to determine the indices of the x values between 0.0 and 15.0.
While this is simple in M
On Friday, October 27, 2017 at 3:35:45 PM UTC-5, Robert wrote:
> I read below code snippet on line. I am interested in the
> second of the last line: `cast=float`. I've tried it in
> Python. Even simply with: `float` It has no error, but what
> use is it?
>
> self.
> num_steps=100,
> style=wx.SL_HORIZONTAL,
> cast=float ,
> proportion=1,
> )
> I am interested in the second of the last line.
>
> cast=float ,
The space doesn't do anything. You have a parameter list, so the
comma just separates "cast=float&qu
Il giorno venerdì 27 ottobre 2017 22:35:45 UTC+2, Robert ha scritto:
> Hi,
>
> I read below code snippet on line. I am interested in the second of the last
> line.
>
> cast=float ,
>
>
> I've tried it in Python. Even simply with
>
> float
>
Hi,
I read below code snippet on line. I am interested in the second of the last
line.
cast=float ,
I've tried it in Python. Even simply with
float
it has no error, but what use is it?
I do see a space before the comma ','. Is it a typo or not?
Thanks,
On Wed, 4 Oct 2017 12:17 pm, Stefan Ram wrote:
> |>>> str(object='abc')
> |'abc'
That's probably also a bug.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, 4 Oct 2017 03:18 am, Stefan Ram wrote:
> »int« and »float« seem to behave quite similar:
>
> |>>> int( x = 8 )
> |8
> |>>> float( x = 8.0 )
> |8.0
I expect that these functions taking a *named* parameter "x" is an accident that
should
On Wed, Oct 4, 2017 at 3:18 AM, Stefan Ram wrote:
> »int« and »float« seem to behave quite similar:
>
> |>>> int( x = 8 )
> |8
> |>>> float( x = 8.0 )
> |8.0
> |>>> int()
> |0
> |>>> float()
> |0.0
>
> . Yet the ways th
gt;> File "calcsignal.py", line 7, in
>> siglevfromexist = 34.8 + existattn
>> TypeError: unsupported operand type(s) for +: 'float' and 'list'
>>
>> How do I convert the list variable (i.e. existattn) to a float?
>>
>> Ope
The value in existattn is a single element list. The single element is a
float, so just refer to it in your calculation, like so:
siglevfromexist = 34.8 + existattn[0]
Regards.
Paul.
On 3 June 2017 at 15:42, Gary Barker wrote:
> I have searched for a solution to this but have not fo
I have searched for a solution to this but have not found a suitable
example.
The attached code generates this error: Traceback (most recent call last):
File "calcsignal.py", line 7, in
siglevfromexist = 34.8 + existattn
TypeError: unsupported operand type(s) for +: 'f
I've been having problems with django FloatFields not round tripping properly;
eg
field = 0.018903438896219302
gets saved and returns as
0.0189034388962193
It turns out that this is a property of the MySQLdb python interface where in
converter.py we have the definition
def Float2Str(o, d):
1 - 100 of 1258 matches
Mail list logo