Re: double bracket integer index in pandas; Is this a legal syntax

2023-05-03 Thread Cameron Simpson
On 03May2023 17:52, Artie Ziff wrote: The code came from a video course, "Pandas Data Analysis with Python Fundamentals" by Daniel Chen. I am curious why the author may have said this. To avoid attaching screenshots, I'll describe this section of the content. Perhaps someone can say, "oh

Re: double bracket integer index in pandas; Is this a legal syntax

2023-05-03 Thread Artie Ziff
I agree with your analysis, Cameron. The code came from a video course, "Pandas Data Analysis with Python Fundamentals" by Daniel Chen. I am curious why the author may have said this. To avoid attaching screenshots, I'll describe this section of the content. Perhaps someone can say, "oh that's

Re: An "adapter", superset of an iterator

2023-05-03 Thread Greg Ewing via Python-list
On 4/05/23 9:29 am, Chris Angelico wrote: So you're asking for map to be able to return an iterator if given an iterator, or an adapter if given an adapter. That makes it quite complicated to use and reason about. Also a bit slower, since it would need to inspect its argument and decide what

RE: An "adapter", superset of an iterator

2023-05-03 Thread avi.e.gross
As others have mentioned features added like this need careful examination not only at effects but costs. As I see it, several somewhat different ideas were raised and one of them strikes me oddly. The whole point of an iterable is to AVOID calculating the next item till needed. Otherwise, you

Re: An "adapter", superset of an iterator

2023-05-03 Thread Chris Angelico
On Thu, 4 May 2023 at 07:43, Thomas Passin wrote: > > On 5/3/2023 3:46 PM, Oscar Benjamin wrote: > > On Wed, 3 May 2023 at 18:52, Thomas Passin wrote: > >> > >> On 5/3/2023 5:45 AM, fedor tryfanau wrote: > >>> I've been using python as a tool to solve competitive programming problems > >>> for a

Re: An "adapter", superset of an iterator

2023-05-03 Thread Thomas Passin
On 5/3/2023 3:46 PM, Oscar Benjamin wrote: On Wed, 3 May 2023 at 18:52, Thomas Passin wrote: On 5/3/2023 5:45 AM, fedor tryfanau wrote: I've been using python as a tool to solve competitive programming problems for a while now and I've noticed a feature, python would benefit from having.

Re: An "adapter", superset of an iterator

2023-05-03 Thread Chris Angelico
On Thu, 4 May 2023 at 02:25, fedor tryfanau wrote: > > I've been using python as a tool to solve competitive programming problems > for a while now and I've noticed a feature, python would benefit from > having. > Consider "reversed(enumerate(a))". This is a perfectly readable code, > except it's

Re: An "adapter", superset of an iterator

2023-05-03 Thread Oscar Benjamin
On Wed, 3 May 2023 at 18:52, Thomas Passin wrote: > > On 5/3/2023 5:45 AM, fedor tryfanau wrote: > > I've been using python as a tool to solve competitive programming problems > > for a while now and I've noticed a feature, python would benefit from > > having. > > Consider

Re: An "adapter", superset of an iterator

2023-05-03 Thread Thomas Passin
On 5/3/2023 5:45 AM, fedor tryfanau wrote: I've been using python as a tool to solve competitive programming problems for a while now and I've noticed a feature, python would benefit from having. Consider "reversed(enumerate(a))". This is a perfectly readable code, except it's wrong in the

Re: Editing PEP-8, in particular "expected 2 blanks, found 1

2023-05-03 Thread Roy Hann
Kevin M. Wilson wrote: > Folks, help please! What the @#$! are these doing popping up. Code styles are > personal, and not subject to debate. [snip] "Expected 2 blanks"? Or "Expected 2 blank _lines_"? Two blank lines between function/method definitions has been recommended for more than 20

An "adapter", superset of an iterator

2023-05-03 Thread fedor tryfanau
I've been using python as a tool to solve competitive programming problems for a while now and I've noticed a feature, python would benefit from having. Consider "reversed(enumerate(a))". This is a perfectly readable code, except it's wrong in the current version of python. That's because

Re: double bracket integer index in pandas; Is this a legal syntax

2023-05-03 Thread Cameron Simpson
On 03May2023 03:41, Artie Ziff wrote: I am hope that pandas questions are OK here. There are some pandas users here. In a panda lecture, I did not get the expected result. I tried this on two different platforms (old macOS distro and up-to-date Ubuntu Linux distro, 22.04) The Linux distro

[Python-announce] PyConZA 2023 - Call for Submissions

2023-05-03 Thread Neil Muller
PyConZA 2023 will take place on the 5th & 6th of October, 2023. This year, PyConZA will be a hybrid conference (with in-person and online access) hosted at the Premier Splendid Inn in Umhlanga, Durban. We are looking for the following presentations: - Keynotes (45 minute long talks on a subject

[Python-announce] Numba 0.57.0 and llvmlite 0.40.0

2023-05-03 Thread Siu Kwan Lam
Dear all, Numba 0.57.0 and llvmlite 0.40.0 have been released. Please see our Discourse for more information: https://numba.discourse.group/t/ann-numba-0-57-0-and-llvmlite-0-40-0/1914 Best, Siu ___ Python-announce-list mailing list --

double bracket integer index in pandas; Is this a legal syntax

2023-05-03 Thread Artie Ziff
Hello, I am hope that pandas questions are OK here. In a panda lecture, I did not get the expected result. I tried this on two different platforms (old macOS distro and up-to-date Ubuntu Linux distro, 22.04) The Linux distro has: python3.10.11 pandas