Re: pandas loc on str lower for column comparison

2019-08-29 Thread Sayth Renshaw
On Friday, 30 August 2019 00:49:32 UTC+10, Piet van Oostrum wrote: > Piet van Oostrum writes: > > > So the correct way to do this is to make df1 a copy rather than a view. > > > > df1 = df.loc[:, ('UID','Name','New Leader','Current Team', 'New Team')] > > Or maybe even make an explicit copy: >

Re: [SOLVED] Re: Compare zip lists where order is important

2019-08-29 Thread Peter Otten
Sayth Renshaw wrote: > On Thursday, 29 August 2019 20:33:46 UTC+10, Peter Otten wrote: >> Sayth Renshaw wrote: >> >> > will find the added >> > pairs, but ignore the removed ones. Is that what you want? >> > >> > Yes, I think. I want to find the changed pairs. The people that moved >> > team nu

Re: if STREAM.isatty():

2019-08-29 Thread Peter Otten
Hongyi Zhao wrote: > On Thu, 29 Aug 2019 16:42:44 +0100, Rhodri James wrote: > >> I don't understand what's to not to understand. >> >>if condition: >> do_something_because_condition_is_true() >>else: >> do_something_because_condition_is_false() >> >> is a perfectly normal con

Re: [SOLVED] Re: Compare zip lists where order is important

2019-08-29 Thread Sayth Renshaw
On Thursday, 29 August 2019 20:33:46 UTC+10, Peter Otten wrote: > Sayth Renshaw wrote: > > > will find the added > > pairs, but ignore the removed ones. Is that what you want? > > > > Yes, I think. I want to find the changed pairs. The people that moved team > > numbers. > > To find the people

Re: if STREAM.isatty():

2019-08-29 Thread Terry Reedy
On 8/29/2019 10:16 AM, Eryk Sun wrote: On 8/29/19, Rhodri James wrote: "isatty()" is a method of the io.IOBase class that checks to see if the stream is connected to a tty, or to use less jargon, if it is interactive. "tty" was I think originally an abbreviation for "teletype", but nowadays i

Re: if STREAM.isatty():

2019-08-29 Thread Cameron Simpson
On 29Aug2019 22:38, Hongyi Zhao wrote: On Thu, 29 Aug 2019 16:42:44 +0100, Rhodri James wrote: The original code snippet's logic is as follows: if STREAM.isatty(): p = (self.progress_template + '\r') % params else: [do something to reset the new value of p]

Re: if STREAM.isatty():

2019-08-29 Thread MRAB
On 2019-08-29 23:38, Hongyi Zhao wrote: On Thu, 29 Aug 2019 16:42:44 +0100, Rhodri James wrote: I don't understand what's to not to understand. if condition: do_something_because_condition_is_true() else: do_something_because_condition_is_false() is a perfectly normal construc

Re: pandas loc on str lower for column comparison

2019-08-29 Thread Sayth Renshaw
On Friday, 30 August 2019 00:49:32 UTC+10, Piet van Oostrum wrote: > Piet van Oostrum > > > So the correct way to do this is to make df1 a copy rather than a view. > > > > df1 = df.loc[:, ('UID','Name','New Leader','Current Team', 'New Team')] > > Or maybe even make an explicit copy: > > df1 =

Re: if STREAM.isatty():

2019-08-29 Thread Terry Reedy
On 8/29/2019 8:23 AM, Rhodri James wrote: On 29/08/2019 04:40, Hongyi Zhao wrote: Hi, I read the following code: https://github.com/shichao-an/homura/blob/master/homura.py On the line 265-266, it said: if STREAM.isatty(): p = (self.progress_template + '\r') % params W

Re: if STREAM.isatty():

2019-08-29 Thread Hongyi Zhao
On Thu, 29 Aug 2019 16:42:44 +0100, Rhodri James wrote: > I don't understand what's to not to understand. > >if condition: > do_something_because_condition_is_true() >else: > do_something_because_condition_is_false() > > is a perfectly normal construction. If you mean somethin

Re: Python unit test framework to fire 1000 unique concurrent requests (rmlibre)

2019-08-29 Thread rmlibre
If you want to try out some libraries to build your own tests, you could try aiohttp, aiodns, and asyncio. The requests using these libraries are made asynchronously, not completely in parallel, but produce a similar effect at lower cost. Some examples and docs on these can be found here: https://d

Re: An "Object" class?

2019-08-29 Thread Cristian Cocos
Thank you! For some reason I didn't think of using issubclass and isinstance in my Python types investigation. As you may have already noticed, I am a Python beginner. I also happen to have a Logic and Foundations of Mathematics background, hence I am tempted to investigate Python's type taxonomy f

Re: if STREAM.isatty():

2019-08-29 Thread Rhodri James
On 29/08/2019 16:29, Hongyi Zhao wrote: On Thu, 29 Aug 2019 14:51:43 +0100, Rhodri James wrote: When the stream isn't connected to an interactive terminal, obviously. For example, when it's writing to file. But I cannot see any thing like this in the code. I don't understand what's to not t

Re: if STREAM.isatty():

2019-08-29 Thread Hongyi Zhao
On Thu, 29 Aug 2019 14:51:43 +0100, Rhodri James wrote: > When the stream isn't connected to an interactive terminal, obviously. > For example, when it's writing to file. But I cannot see any thing like this in the code. Regards -- https://mail.python.org/mailman/listinfo/python-list

Re: pandas loc on str lower for column comparison

2019-08-29 Thread Piet van Oostrum
Piet van Oostrum writes: > So the correct way to do this is to make df1 a copy rather than a view. > > df1 = df.loc[:, ('UID','Name','New Leader','Current Team', 'New Team')] Or maybe even make an explicit copy: df1 = df[['UID','Name','New Leader','Current Team', 'New Team']].copy() -- Piet va

Re: pandas loc on str lower for column comparison

2019-08-29 Thread Piet van Oostrum
Sayth Renshaw writes: > Hi > > I am importing 4 columns into a dataframe from a spreadsheet. > > My goal is to create a 5th column with TRUE or False if column 4 (str) > matches column 3. > > Trying to leverage this answer https://stackoverflow.com/a/35940955/461887 > > This is my code > > impo

Re: if STREAM.isatty():

2019-08-29 Thread Eryk Sun
On 8/29/19, Rhodri James wrote: > > "isatty()" is a method of the io.IOBase class that checks to see > if the stream is connected to a tty, or to use less jargon, if it is > interactive. "tty" was I think originally an abbreviation for > "teletype", but nowadays it refers to any terminal, anywher

Re: if STREAM.isatty():

2019-08-29 Thread Rhodri James
On 29/08/2019 14:37, Hongyi Zhao wrote: On Thu, 29 Aug 2019 13:23:07 +0100, Rhodri James wrote: TLDR: these two lines set up (but don't output) a progress message for an interactive stream. Thanks a lot for your deeply notes on this. But, if so, when will the ``else ...'' be executed in the o

Re: if STREAM.isatty():

2019-08-29 Thread Hongyi Zhao
On Thu, 29 Aug 2019 13:23:07 +0100, Rhodri James wrote: > TLDR: these two lines set up (but don't output) a progress message for > an interactive stream. Thanks a lot for your deeply notes on this. But, if so, when will the ``else ...'' be executed in the original code: if STREAM.isat

Re: if STREAM.isatty():

2019-08-29 Thread Rhodri James
On 29/08/2019 04:40, Hongyi Zhao wrote: Hi, I read the following code: https://github.com/shichao-an/homura/blob/master/homura.py On the line 265-266, it said: if STREAM.isatty(): p = (self.progress_template + '\r') % params What's mean by using the above two lines? C

Re: unable to to install paython

2019-08-29 Thread o1bigtenor
On Thu, Aug 29, 2019 at 12:51 AM Alemu Geletew via Python-list wrote: > Hmm - - - - somehow you think that other members of this list can somehow understand what you did do - - - - without you even telling them. As my crystal ball (for future readings and such) hasn't ever worked it would

Re: [SOLVED] Re: Compare zip lists where order is important

2019-08-29 Thread Peter Otten
Sayth Renshaw wrote: > will find the added > pairs, but ignore the removed ones. Is that what you want? > > Yes, I think. I want to find the changed pairs. The people that moved team > numbers. To find the people that moved team numbers I would tear the pairs apart. Like: >>> people = ["Tim","

Re: [SOLVED] Re: Compare zip lists where order is important

2019-08-29 Thread Sayth Renshaw
will find the added pairs, but ignore the removed ones. Is that what you want? Yes, I think. I want to find the changed pairs. The people that moved team numbers. Sayth -- https://mail.python.org/mailman/listinfo/python-list