Re: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-21 Thread Greg Ewing
On 22/11/21 4:58 am, Grant Edwards wrote: Yep, IIRC, it was a 4 bit processor because 4 bits is what it takes to represent one decimal digit. That was the Saturn, first used in the HP-71B. The original architecture (known as the "Nut")was weirder than that. It operated serially on 56 bit words

Re: doubt About import machine

2021-11-21 Thread Joe Pfeiffer
Daniel Eduardo Almeida Correa writes: > Hello, I'm trying to use the machine library in python 3.10 version, but I > can't import it with the pip install machine, could you tell me a way to > solve it or a python version compatible with the library? Thank you a lot > for your answer. The "machi

Re: doubt About import machine

2021-11-21 Thread MRAB
On 2021-11-21 18:36, Daniel Eduardo Almeida Correa wrote: Hello, I'm trying to use the machine library in python 3.10 version, but I can't import it with the pip install machine, could you tell me a way to solve it or a python version compatible with the library? Thank you a lot for your answer.

Re: get_axes not present?

2021-11-21 Thread Mahmood Naderan via Python-list
>Your example isn't minimal enough for me to be able to pin it down any >better than that, though. Chris, I was able to simply it even further. Please look at this: $ cat test.batch.csv Value,Value 10,2 5,2 10,2 $ cat test.py import pandas as pd import csv,sys import matplotlib import matplot

Re: get_axes not present?

2021-11-21 Thread Mahmood Naderan via Python-list
>I installed the latest pandas, although on Python 3.10, and the script >worked without a problem. Yes as I wrote it works with 1.3.3 but mine is 1.2.3. I am trying to keep the current version because of the possible future consequences. In the end maybe I have to upgrade the pandas. Regards,

Re: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-21 Thread Peter J. Holzer
On 2021-11-22 05:43:48 +1100, Chris Angelico wrote: > On Mon, Nov 22, 2021 at 5:42 AM Peter J. Holzer wrote: > > (I think I used Math::BigRat in Perl, but I've been > > programming in Perl for a lot longer.) > > Rodents Of Unusual Size? I don't think they exist... https://www.girlgeniusonline.co

Re: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-21 Thread Peter J. Holzer
On 2021-11-21 10:57:55 +1100, Chris Angelico wrote: > And if decimal floating point were common, other "surprise" behaviour > would be cited, like how x < y and (x+y)/2 < x. Yup. Took me a bit to find an example, but this can happen. My HP-48 calculator uses a mantissa of 12 decimal digits. 6

Re: frozenset can be altered by |=

2021-11-21 Thread Jach Feng
Marco Sulla 在 2021年11月20日 星期六上午5:12:19 [UTC+8] 的信中寫道: > (venv_3_10) marco@buzz:~$ python > Python 3.10.0 (heads/3.10-dirty:f6e8b80d20, Nov 18 2021, 19:16:18) > [GCC 10.1.1 20200718] on linux > Type "help", "copyright", "credits" or "license" for more information. > >>> a = frozenset((3, 4)) >

doubt About import machine

2021-11-21 Thread Daniel Eduardo Almeida Correa
Hello, I'm trying to use the machine library in python 3.10 version, but I can't import it with the pip install machine, could you tell me a way to solve it or a python version compatible with the library? Thank you a lot for your answer. -- https://mail.python.org/mailman/listinfo/python-list

Re: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-21 Thread Chris Angelico
On Mon, Nov 22, 2021 at 5:42 AM Peter J. Holzer wrote: > (I think I used Math::BigRat in Perl, but I've been > programming in Perl for a lot longer.) > Rodents Of Unusual Size? I don't think they exist... ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-21 Thread Peter J. Holzer
On 2021-11-20 03:25:53 +, Ben Bacarisse wrote: > Chris Angelico writes: > > > It does mean exactly what it meant in grade school, just as 1/3 means > > exactly what it meant in grade school. Now try to represent 1/3 on a > > blackboard, as a decimal fraction. If that's impossible, does it mea

Re: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-21 Thread Peter J. Holzer
On 2021-11-19 12:43:07 +0100, ast wrote: > Le 19/11/2021 à 03:51, MRAB a écrit : > > On 2021-11-19 02:40, 2qdxy4rzwzuui...@potatochowder.com wrote: > > > On 2021-11-18 at 23:16:32 -0300, > > > René Silva Valdés wrote: > > > > Hello, I would like to report the following issue: > > > > > > > > Work

Re: Advantages of Default Factory in Dataclasses

2021-11-21 Thread Paul Bryan
On Sun, 2021-11-21 at 21:51 +0400, Abdur-Rahmaan Janhangeer wrote: > > On Tue, Nov 16, 2021 at 7:17 PM Paul Bryan wrote: > > On Tue, 2021-11-16 at 17:04 +0400, Abdur-Rahmaan Janhangeer wrote: > > > > > A simple question: why do we need field(default_factory ) in > > > dataclasses? > > > > > >

Re: Advantages of Default Factory in Dataclasses

2021-11-21 Thread Abdur-Rahmaan Janhangeer
On Tue, Nov 16, 2021 at 7:17 PM Paul Bryan wrote: > On Tue, 2021-11-16 at 17:04 +0400, Abdur-Rahmaan Janhangeer wrote: > > A simple question: why do we need field(default_factory ) in dataclasses? > > > To initialize a default value when a new instance of the dataclass is > created. For example,

Re: get_axes not present?

2021-11-21 Thread MRAB
On 2021-11-21 16:39, Mahmood Naderan via Python-list wrote: The best way to get assistance here on the list is to create a minimal, self-contained, run-able, example program that you can post in its entirety here that demonstrates the issue. I created a sample code with input. Since the code p

Re: get_axes not present?

2021-11-21 Thread Chris Angelico
On Mon, Nov 22, 2021 at 3:40 AM Mahmood Naderan via Python-list wrote: > File > "/home/mahmood/.local/lib/python3.8/site-packages/pandas/plotting/_matplotlib/core.py", > line 903, in _get_subplots > ax for ax in self.axes[0].get_figure().get_axes() if isinstance(ax, > Subplot) > Attribute

Re: get_axes not present?

2021-11-21 Thread Mahmood Naderan via Python-list
>The best way to get >assistance here on the list is to create a minimal, self-contained, >run-able, example program that you can post in its entirety here that >demonstrates the issue. I created a sample code with input. Since the code processes a csv file to group input rows, I also included t

Re: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-21 Thread Grant Edwards
On 2021-11-21, Greg Ewing wrote: > On 21/11/21 2:18 pm, Grant Edwards wrote: >> My recollection is that it was quite common back in the days before FP >> hardware was "a thing" on small computers. CPM and DOS compilers for >> various languages often gave the user a choice between binary FP and >>

Re: get_axes not present?

2021-11-21 Thread Michael Torrie
On 11/19/21 10:38 AM, Mahmood Naderan wrote: >> And what is the result of plot()?  Is it a valid object, or is it None? > > Well the error happens on the plot() line. I tried to print some information > like this: > > Any thoughts on that? It's not really possible for us to know what is happeni

Re: pytest segfault, not with -v

2021-11-21 Thread Barry
I would run the whole set of tests under gdb and wait for the segv to happen. You may find that an isolated test will pass. Sometimes it is a sequence of test and lead to the segv. Barry > On 19 Nov 2021, at 23:48, Marco Sulla wrote: > > On Fri, 19 Nov 2021 at 20:38, MRAB wrote: >> >>> On 20