Re: Is there a way to subtract 3 from every digit of a number?

2021-02-21 Thread C W
Thanks so much everyone, I appreciate it! Ming, your solution is awesome. More importantly, very clear explanations on how and why. So, I appreciate that. Thanks again, cheers! Mike On Sun, Feb 21, 2021 at 12:08 AM <2qdxy4rzwzuui...@potatochowder.com> wrote: > On 2021-02-20 at 20:49:15 -0800,

Re: Is there a way to subtract 3 from every digit of a number?

2021-02-21 Thread C W
I do want to follow up, if I may. In Ming's example, a = 2342 b = int("".join(map(lambda x: str((int(x)-3)%10) ,list(str(a) What's the best approach to apply to a dataframe column, rather than just one value? Here's my attempt using df[col_1''].apply(), df['col_1'].apply(lambda:a int("".join

Re: Is there a way to subtract 3 from every digit of a number?

2021-02-21 Thread C W
I got it to work! I defined a separate function, and put it into df['col_1'].apply(). Not the most elegant, but it worked. I'm also curious how people on this mailing list would do it. Cheers! On Sun, Feb 21, 2021 at 9:21 AM C W wrote: > I do want to follow up, if I may. In Ming's example, > >

RE: Is there a way to subtract 3 from every digit of a number?

2021-02-21 Thread Avi Gross via Python-list
Mike, You moved the goalpost. Some of us here have been speculating you were asking what we call a homework question here. The problem seemed to be the kind asked for that can be done using fairly simple commands in python combined together. Of course, some of the answers posted used ideas usua

Re: Is there a way to subtract 3 from every digit of a number?

2021-02-21 Thread Chris Angelico
On Mon, Feb 22, 2021 at 1:39 AM Avi Gross via Python-list wrote: > But you just moved the goalpost by talking about using a data.frame as that > (and I assume numpy and pandas) are not very basic Python. Given that the original post mentioned a pd.Series, I don't know how far the goalposts actual

Re: Is there a way to subtract 3 from every digit of a number?

2021-02-21 Thread C W
Hey Avi, I am a long time R user now using Python. So, this is my attempt to master the language. The problem for me is that I often have an idea about how things are done in R, but not sure to what functions are available in Python. I hope that clears up some confusion. Cheer! On Sun, Feb 21,

RE: Is there a way to subtract 3 from every digit of a number?

2021-02-21 Thread Avi Gross via Python-list
Chris, I admit I must have missed that. I was trying to understand the overall request. I do most of my data.frame work in another language 😉 I will say that there are many problems that live at various levels. The original request could have been about how o covert a 1-digit integer which wou

Re: Is there a way to subtract 3 from every digit of a number?

2021-02-21 Thread 2QdxY4RzWzUUiLuE
On 2021-02-21 at 09:28:39 -0500, C W wrote: > I got it to work! I defined a separate function, and put it into > df['col_1'].apply(). > > Not the most elegant, but it worked. I'm also curious how people on this > mailing list would do it. I don't know anything about pandas, but for one string o

RE: Is there a way to subtract 3 from every digit of a number?

2021-02-21 Thread Avi Gross via Python-list
Ah, that is an interesting, Mike, but not an informative answer. My question is where the specific problem came from. Yes, someone used to R and coming to Python might work at adjusting to what is different and how to get things done. I do that all the time as one hobby is learning lots of langua

Re: Is there a way to subtract 3 from every digit of a number?

2021-02-21 Thread Stestagg
With numpy and pandas, it's almost always best to start off with the simple, obvious solution. In your case, I would recommend defining a function, and calling `Series.map`, passing in that function. Sometimes, however, with large datasets, it's possible to use some pandas/numpy tricks to signif

Logging with 2 process in application

2021-02-21 Thread gayatri funde
Hello, Greetings!! Have a good day! This is regarding logging issue i am facing in my application. My requirement is to create log on daily basis while my application is running, So to do this i am creating new log file at midnight by comparing the day it starts and enter to new day with the w

Re: Logging with 2 process in application

2021-02-21 Thread Dan Stromberg
On Sun, Feb 21, 2021 at 9:10 PM gayatri funde wrote: > Hello, > > Greetings!! Have a good day! > > This is regarding logging issue i am facing in my application. My > requirement is to create log on daily basis while my application is > running, So to do this i am creating new log file at midnigh

Re: Logging with 2 process in application

2021-02-21 Thread Chris Angelico
On Mon, Feb 22, 2021 at 4:11 PM gayatri funde wrote: > > Hello, > > Greetings!! Have a good day! > > This is regarding logging issue i am facing in my application. My requirement > is to create log on daily basis while my application is running, So to do > this i am creating new log file at midn

Re: Logging with 2 process in application

2021-02-21 Thread gayatri funde
On Monday, February 22, 2021 at 10:47:57 AM UTC+5:30, Dan Stromberg wrote: > On Sun, Feb 21, 2021 at 9:10 PM gayatri funde > wrote: > > Hello, > > > > Greetings!! Have a good day! > > > > This is regarding logging issue i am facing in my application. My > > requirement is to create log on da

Re: Logging with 2 process in application

2021-02-21 Thread Chris Angelico
On Mon, Feb 22, 2021 at 4:41 PM gayatri funde wrote: > > On Monday, February 22, 2021 at 10:47:57 AM UTC+5:30, Dan Stromberg wrote: > > On Sun, Feb 21, 2021 at 9:10 PM gayatri funde > > wrote: > > > Hello, > > > > > > Greetings!! Have a good day! > > > > > > This is regarding logging issue i am f

Re: Logging with 2 process in application

2021-02-21 Thread gayatri funde
On Monday, February 22, 2021 at 10:49:36 AM UTC+5:30, Chris Angelico wrote: > On Mon, Feb 22, 2021 at 4:11 PM gayatri funde wrote: > > > > Hello, > > > > Greetings!! Have a good day! > > > > This is regarding logging issue i am facing in my application. My > > requirement is to create log o

Re: Logging with 2 process in application

2021-02-21 Thread gayatri funde
On Monday, February 22, 2021 at 11:15:27 AM UTC+5:30, Chris Angelico wrote: > On Mon, Feb 22, 2021 at 4:41 PM gayatri funde wrote: > > > > On Monday, February 22, 2021 at 10:47:57 AM UTC+5:30, Dan Stromberg wrote: > > > On Sun, Feb 21, 2021 at 9:10 PM gayatri funde > > > wrote: > > > > Hello

Re: Logging with 2 process in application

2021-02-21 Thread Chris Angelico
On Mon, Feb 22, 2021 at 5:01 PM gayatri funde wrote: > I have 2 files mainModule.py and loggingModule.py files as below: > In loggingModule.py file i am managing new log to create , which i am > importing to mainModule.py file. > > def child_Process(var1): > while True: > time.sleep(1

Re: Logging with 2 process in application

2021-02-21 Thread gayatri funde
On Monday, February 22, 2021 at 11:33:57 AM UTC+5:30, Chris Angelico wrote: > On Mon, Feb 22, 2021 at 5:01 PM gayatri funde wrote: > > I have 2 files mainModule.py and loggingModule.py files as below: > > In loggingModule.py file i am managing new log to create , which i am > > importing to mai