Help on Code logic to remove duplicate mails from webapp mail box

2019-10-30 Thread emanbanerjee
Hi I am working on a project where we make connections to webapp mail and extract subject, sender,body etc from mails and save it in dataframe and insert it n SQL DB. My next challenge is to remove any duplicate mails from mailbox. Could you kindly help me. It can be a new mail which is

Re: Help on Code logic to remove duplicate mails from webapp mail box

2019-10-30 Thread Chris Angelico
On Wed, Oct 30, 2019 at 6:36 PM eman banerjee wrote: > > On Wednesday, 30 October 2019 12:40:06 UTC+5:30, eman banerjee wrote: > > Hi > > > > I am working on a project where we make connections to webapp mail and > > extract subject, sender,body etc from mails and save it in dataframe and > >

Re: Help on Code logic to remove duplicate mails from webapp mail box

2019-10-30 Thread eman banerjee
On Wednesday, 30 October 2019 12:40:06 UTC+5:30, eman banerjee wrote: > Hi > > I am working on a project where we make connections to webapp mail and > extract subject, sender,body etc from mails and save it in dataframe and > insert it n SQL DB. > > My next challenge is to remove any

Re: Help debugging code - Negative lookahead problem

2017-02-26 Thread michael . gauthier . uni
WOW, many thanks guys, Peter, and MRAB, for your time, help, and explanations! Peter, yes, you're right, when things get too complicated I should definitely try to split things up, and thus split the difficulties (ah, Descartes... ^^), thanks for the advice! MRAB, your code is now working,

Re: Help debugging code - Negative lookahead problem

2017-02-26 Thread MRAB
On 2017-02-26 17:15, michael.gauthier@gmail.com wrote: Hi MRAB, Thanks for taking time to look at my problem! I tried your solution: r"\d{2}\s?(?=(?:years old\s?|yo\s?|yr old\s?|y o\s?|yrs old\s?|year old\s?)(?!son|daughter|kid|child))" but unfortunately it does seem not work. Also, I

Re: Help debugging code - Negative lookahead problem

2017-02-26 Thread Peter Otten
michael.gauthier@gmail.com wrote: > Hi MRAB, > > Thanks for taking time to look at my problem! > > I tried your solution: > > r"\d{2}\s?(?=(?:years old\s?|yo\s?|yr old\s?|y o\s?|yrs old\s?|year > old\s?)(?!son|daughter|kid|child))" > > but unfortunately it does seem not work. Also, I

Re: Help debugging code - Negative lookahead problem

2017-02-26 Thread michael . gauthier . uni
Hi MRAB, Thanks for taking time to look at my problem! I tried your solution: r"\d{2}\s?(?=(?:years old\s?|yo\s?|yr old\s?|y o\s?|yrs old\s?|year old\s?)(?!son|daughter|kid|child))" but unfortunately it does seem not work. Also, I tried adding the negative lookaheads after every one of the

Re: Help debugging code - Negative lookahead problem

2017-02-26 Thread MRAB
On 2017-02-26 14:13, michael.gauthier@gmail.com wrote: Hi everyone, So here is my problem. I have a bunch of tweets and various metadata that I want to analyze for sociolinguistic purposes. In order to do this, I'm trying to infer users' ages thanks to the information they provide in

Help debugging code - Negative lookahead problem

2017-02-26 Thread michael . gauthier . uni
Hi everyone, So here is my problem. I have a bunch of tweets and various metadata that I want to analyze for sociolinguistic purposes. In order to do this, I'm trying to infer users' ages thanks to the information they provide in their bio, among others. For that I'm using regular expressions

Help on code comprehension from an example project of pymc

2015-12-15 Thread Robert
Hi, I find the useful small code project for me: #https://users.obs.carnegiescience.edu/cburns/ipynbs/PyMC.html It runs as expected. When I review the code, I find 'data' in the original line: data = pymc.Normal('data', mu=model, tau=tau, value=z_obs, observed=True) has not been referenced

Re: Help on code comprehension from an example project of pymc

2015-12-15 Thread Chris Angelico
On Wed, Dec 16, 2015 at 3:15 AM, Robert wrote: > When I review the code, I find 'data' in the original line: > > data = pymc.Normal('data', mu=model, tau=tau, value=z_obs, observed=True) > > has not been referenced thereafter. > If I comment out the line as: > > #data =

Re: Help on code comprehension from an example project of pymc

2015-12-15 Thread Terry Reedy
On 12/15/2015 11:15 AM, Robert wrote: Hi, I find the useful small code project for me: #https://users.obs.carnegiescience.edu/cburns/ipynbs/PyMC.html It runs as expected. When I review the code, I find 'data' in the original line: data = pymc.Normal('data', mu=model, tau=tau, value=z_obs,

Re: Need help vectorizing code

2014-01-19 Thread Oscar Benjamin
On 18 January 2014 20:51, Kevin K richyoke...@gmail.com wrote: I have some code that I need help vectorizing. I want to convert the following to vector form, how can I? I want to get rid of the inner loop - apparently, it's possible to do so. X is an NxD matrix. y is a 1xD vector. def

Need help vectorizing code

2014-01-18 Thread Kevin K
I have some code that I need help vectorizing. I want to convert the following to vector form, how can I? I want to get rid of the inner loop - apparently, it's possible to do so. X is an NxD matrix. y is a 1xD vector. def foo(X, y, mylambda, N, D, epsilon): ... for j in xrange(D):

Re: Need help vectorizing code

2014-01-18 Thread Joshua Landau
On 18 January 2014 20:51, Kevin K richyoke...@gmail.com wrote: def foo(X, y, mylambda, N, D, epsilon): ... for j in xrange(D): aj = 0 cj = 0 for i in xrange(N): aj += 2 * (X[i,j] ** 2) cj += 2 * (X[i,j] * (y[i] -

Re: Need help vectorizing code

2014-01-18 Thread Kevin K
I didn't paste the whole function, note the ... before and after. I do use the values. I want to get rid of one of the loops so that the computation becomes O(D). Assume vectors a and c should get populated during the compute, each being 1xD. Thanks On Saturday, January 18, 2014 12:51:25 PM

Re: Need help vectorizing code

2014-01-18 Thread Peter Otten
Kevin K wrote: I have some code that I need help vectorizing. I want to convert the following to vector form, how can I? I want to get rid of the inner loop - apparently, it's possible to do so. X is an NxD matrix. y is a 1xD vector. def foo(X, y, mylambda, N, D, epsilon): ...

Re: help to code...

2013-05-03 Thread Matteo Boscolo
The error is self expleined .. print str(current_month) + '/' + str(current_day) + '/' + str(current_year) +' *'+ * this line have a + at the end,the interpreter need something to add .. so remove it and it will work regards, Matteo Il 02/05/2013 15:50, leonardo selmi ha scritto: dear

help to code...

2013-05-02 Thread leonardo selmi
dear python community, i wrote the following program: from datetime import datetime now = datetime.now() current_month = now.month current_day = now.day current_year = now.year current_hour = now.hour current_minute = now.minute current_second = now.second print str(current_month) + '/' +

Re: help to code...

2013-05-02 Thread Chris Angelico
On Thu, May 2, 2013 at 11:50 PM, leonardo selmi l.se...@icloud.com wrote: dear python community, i wrote the following program: print str(current_month) + '/' + str(current_day) + '/' + str(current_year) +' '+ print str(current_hour) + str(current_minute) + str(current_second)

Re: help to code...

2013-05-02 Thread MRAB
On 02/05/2013 14:50, leonardo selmi wrote: dear python community, i wrote the following program: from datetime import datetime now = datetime.now() current_month = now.month current_day = now.day current_year = now.year current_hour = now.hour current_minute = now.minute current_second =

Re: help to code...

2013-05-02 Thread Mark Lawrence
On 02/05/2013 15:59, Chris Angelico wrote: On Thu, May 2, 2013 at 11:50 PM, leonardo selmi l.se...@icloud.com wrote: dear python community, i wrote the following program: print str(current_month) + '/' + str(current_day) + '/' + str(current_year) +' '+ print str(current_hour) +

Re: help to code...

2013-05-02 Thread MRAB
On 02/05/2013 16:26, Mark Lawrence wrote: On 02/05/2013 15:59, Chris Angelico wrote: On Thu, May 2, 2013 at 11:50 PM, leonardo selmi l.se...@icloud.com wrote: dear python community, i wrote the following program: print str(current_month) + '/' + str(current_day) + '/' + str(current_year) +'

Re: help to code...

2013-05-02 Thread Mark Lawrence
On 02/05/2013 16:37, MRAB wrote: On 02/05/2013 16:26, Mark Lawrence wrote: On 02/05/2013 15:59, Chris Angelico wrote: On Thu, May 2, 2013 at 11:50 PM, leonardo selmi l.se...@icloud.com wrote: dear python community, i wrote the following program: print str(current_month) + '/' +

Re: [Python-Help] help to code...

2013-05-02 Thread bob gailer
On 5/2/2013 9:50 AM, leonardo selmi wrote: Please in future post plain text. -- http://mail.python.org/mailman/listinfo/python-list

Asking for help with code? Post a minimal working example. (was: importing modules dynamicly)

2011-01-11 Thread Ben Finney
Jean-Michel Pichavant jeanmic...@sequans.com writes: Your code is rather strange, 'modules' looks to be a list or some iterable, and then you expect to have a 'modulename' attribute or something... My guess is that you pasted an approximative translation of your code which makes it

Re: Help with code-lists and strings

2011-01-06 Thread Dave Angel
On 01/06/2011 12:28 AM, Steven Howe wrote: On 01/05/2011 07:17 PM, Dave Angel wrote: On 01/-10/-28163 02:59 PM, GrayShark wrote: snip In python it's best to build up you functional needs. So two steps. First a nand (negative 'and' operation). Then wrap that with a function to create two

RE: Help with code-lists and strings

2011-01-06 Thread Rob Richardson
Cathy, Please take another try at writing your program, using what advice you have received so far that you understand. I think this discussion is going rather far away from what you need, and seeing another step in the evolution of your program should help bring it back on track. I like your

Help with code-lists and strings

2011-01-05 Thread Cathy James
Dear all, You folks will probably hear from me more often in the next few months. I hope some of you have time help me on occassion. Actually, a volunteer mentor would be greatly appreciated:) I am learning python and came across an excercise where i need to use lists to strip words from a

RE: Help with code-lists and strings

2011-01-05 Thread Rob Richardson
-list-bounces+rob.richardson=rad-con@python.org [mailto:python-list-bounces+rob.richardson=rad-con@python.org] On Behalf Of Cathy James Sent: Wednesday, January 05, 2011 12:57 PM To: python-list@python.org Subject: Help with code-lists and strings Dear all, You folks will probably hear

Re: Help with code-lists and strings

2011-01-05 Thread Terry Reedy
On 1/5/2011 12:57 PM, Cathy James wrote: I am learning python and came across an excercise where i need to use lists to strip words from a sentence; starting with those containing one or more uppercase letters, followed by words with lower case letters. When writing code, it is good to start

Re: Help with code-lists and strings

2011-01-05 Thread GrayShark
On Wed, 05 Jan 2011 14:58:05 -0500, Terry Reedy wrote: On 1/5/2011 12:57 PM, Cathy James wrote: I am learning python and came across an excercise where i need to use lists to strip words from a sentence; starting with those containing one or more uppercase letters, followed by words with

Re: Help with code-lists and strings

2011-01-05 Thread Cathy James
or body 'help' to python-list-requ...@python.org You can reach the person managing the list at python-list-ow...@python.org When replying, please edit your Subject line so it is more specific than Re: Contents of Python-list digest... Today's Topics: 1. Re: Help with code-lists

Re: Help with code-lists and strings

2011-01-05 Thread Dave Angel
On 01/-10/-28163 02:59 PM, GrayShark wrote: snip In python it's best to build up you functional needs. So two steps. First a nand (negative 'and' operation). Then wrap that with a function to create two strings of your list element, you''re calling 'word'. By the way, list is reserved word,

Re: Help with code-lists and strings

2011-01-05 Thread Steven D'Aprano
Apologies if this comes through twice, I'm having problems with my news client and/or provider. On Wed, 05 Jan 2011 16:56:40 -0600, GrayShark wrote: In python it's best to build up you functional needs. So two steps. First a nand (negative 'and' operation). Then wrap that with a function to

Re: Help with code-lists and strings

2011-01-05 Thread Chris Rebert
On Wed, Jan 5, 2011 at 6:39 PM, Cathy James nambo...@gmail.com wrote: Thank you all for your help. 1) I need to list words with uppercase first, then those with lower case; I used istitle() and isupper (don't know the method for mixed case yet) 2) Steve, it's a compliment that you though I'd

Re: help in code

2010-08-30 Thread Ulrich Eckhardt
Steven D'Aprano wrote: [reading Bengali] In Python 2, you probably need to do this: f = open(filename) bytes = f.read() text = bytes.decode('which-encoding-you-use') f.close() In Python 2, I'd rather take a look at the codecs module (see http://docs.python.org), namely the codecs.open

Re: help in code

2010-08-24 Thread Steven D'Aprano
On Mon, 23 Aug 2010 22:40:04 -0700, pahi sharma wrote: I am new to python .I have a corpus which is written in Bengali and i want to read that file using python code.Can anyone help me in this matter. In Python 3, I believe this should work: f = open(filename,

help in code

2010-08-23 Thread pahi sharma
I am new to python .I have a corpus which is written in Bengali and i want to read that file using python code.Can anyone help me in this matter. Thank You -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with code = Extract numerical value to variable

2009-10-23 Thread Steve
Sorry I'm not being clear Input** sold: 16 sold: 20 sold: 2 sold: 0 sold: storefront 7 0 storefront sold null Output 16 20 2 0 0 7 0 0 0 0 -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with code = Extract numerical value to variable

2009-10-23 Thread Sion Arrowsmith
Steve zerocostprod...@gmail.com wrote: If there is a number in the line I want the number otherwise I want a 0 I don't think I can use strip because the lines have no standards What do you think strip() does? Read http://docs.python.org/library/stdtypes.html#str.lstrip *carefully*

Help with code = Extract numerical value to variable

2009-10-23 Thread Dave Angel
Steve wrote: Sorry I'm not being clear Input** sold: 16 sold: 20 sold: 2 sold: 0 sold: storefront 7 0 storefront sold null Output 16 20 2 0 0 7 0 0 0 0 Since you're looking for only digits, simply make a string containing all characters that aren't digits. Now, loop

Re: Help with code = Extract numerical value to variable

2009-10-23 Thread rurpy
On 10/23/2009 05:16 AM, Dave Angel wrote: Steve wrote: Sorry I'm not being clear Input** sold: 16 sold: 20 sold: 2 sold: 0 sold: storefront 7 0 storefront sold null Output 16 20 2 0 0 7 0 0 0 0 Since you're looking for only digits, simply make a string

Re: Help with code = Extract numerical value to variable

2009-10-22 Thread Peter Pearson
On Thu, 22 Oct 2009 10:27:57 -0700 (PDT), Steve wrote: I have some data that I'm performing some analysis on. How do I grab the numerical value if it's present and ignore otherwise. So in the following example I would have assign the following values to my var 16 20 2 7 0 In Field6

Re: Help with code = Extract numerical value to variable

2009-10-22 Thread rurpy
On Oct 22, 11:27 am, Steve zerocostprod...@gmail.com wrote: I have some data that I'm performing some analysis on. How do I grab the numerical value if it's present and ignore otherwise. So in the following example I would have assign the following values to my var 16 20 2 7 0 In Field6

Re: Help with code = Extract numerical value to variable

2009-10-22 Thread Steve
If there is a number in the line I want the number otherwise I want a 0 I don't think I can use strip because the lines have no standards Thanks again Steve On Oct 22, 1:53 pm, ru...@yahoo.com wrote: On Oct 22, 11:27 am, Steve zerocostprod...@gmail.com wrote: I have some data that I'm

Re: Help with code = Extract numerical value to variable

2009-10-22 Thread rurpy
Sorry, I still don't understand. I gather you don't literally want a 0 output for every line that does not contain a number since then your output would be, 0, 0, 16, 20, ... (I'm assuming you want to ignore the 6 in In Field6) which does not match your sample output. Do you mean, for every sold:

Re: Help with code! Gamepad?

2009-04-24 Thread DC16
On Apr 23, 4:03 pm, Mike Driscoll kyoso...@gmail.com wrote: On Apr 23, 6:46 am, DC16 luster...@gmail.com wrote: I am using pygame and OpenGL. How do I make a gamepad able to move the camera to a side of a cube on screen. Here is the code for keyboard use: import pygame from

Re: Help with code! Gamepad?

2009-04-24 Thread Mike Driscoll
On Apr 24, 10:11 am, DC16 luster...@gmail.com wrote: On Apr 23, 4:03 pm, Mike Driscoll kyoso...@gmail.com wrote: On Apr 23, 6:46 am, DC16 luster...@gmail.com wrote: I am using pygame and OpenGL. How do I make a gamepad able to move the camera to a side of a cube on screen. Here

Help with code! Gamepad?

2009-04-23 Thread DC16
I am using pygame and OpenGL. How do I make a gamepad able to move the camera to a side of a cube on screen. Here is the code for keyboard use: import pygame from pygame.locals import * import sys from OpenGLLibrary import * pygame.init() Screen = (800,600) Window =

Re: Help with code! Gamepad?

2009-04-23 Thread Mike Driscoll
On Apr 23, 6:46 am, DC16 luster...@gmail.com wrote: I am using pygame and OpenGL. How do I make a gamepad able to move the camera to a side of a cube on screen. Here is the code for keyboard use: import pygame from pygame.locals import * import sys from OpenGLLibrary import *

Help Deciphering Code

2007-03-05 Thread Bryan Leber
Good Morning, I am learning python and I am having to make some changes on an existing python script. What happens is that one scripts creates an xml document that looks like this: CommitOperation file=IPM2.1/Identity/IdentityWebApp/Source/com/fisc/prioss/dataservice/ component/profile

Re: Help Deciphering Code

2007-03-05 Thread Terry Reedy
Bryan Leber [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I am learning python and I am having to make some changes on an existing python script. What happens is that one scripts creates an xml document that looks like this: CommitOperation

Help! Identical code doesn't work in Wing IDE but does in Komodo.

2006-04-20 Thread fyleow
I create a new Python file with the following using Wing IDE. import feedparser d = feedparser.parse(http://feedparser.org/docs/examples/atom10.xml;) print d.feed.title I get this error when I debug. AssertionError: Traceback (innermost last): File c:\Documents and Settings\abc\Application

Re: Help! Identical code doesn't work in Wing IDE but does in Komodo.

2006-04-20 Thread Luke Plant
With the exact same line of code in Komodo I get the correct output which is Sample Feed Any idea what's wrong? My guess would be different PYTHONPATHs. Try this on each: import sys print sys.path They might even be using different python versions - but both of these are just guesses.

Re: Help! Identical code doesn't work in Wing IDE but does in Komodo.

2006-04-20 Thread Serge Orlov
fyleow wrote: I create a new Python file with the following using Wing IDE. import feedparser d = feedparser.parse(http://feedparser.org/docs/examples/atom10.xml;) print d.feed.title I get this error when I debug. AssertionError: Traceback (innermost last): File c:\Documents and

Re: Help! Identical code doesn't work in Wing IDE but does in Komodo.

2006-04-20 Thread John Machin
On 20/04/2006 5:54 PM, fyleow wrote: I create a new Python file with the following using Wing IDE. import feedparser d = feedparser.parse(http://feedparser.org/docs/examples/atom10.xml;) print d.feed.title I get this error when I debug. [snip] With the exact same line of code in

Re: Help! Identical code doesn't work in Wing IDE but does in Komodo.

2006-04-20 Thread BartlebyScrivener
Not sure if this would cause it, but I also have both Wing and Komodo, and when I search for files named FeedParser, I get this: c:/Documents and Settings\Richard Dooling\Local Settings\Application Data\Wing IDE 2\cache\analysis\C\Python24\lib\email\FeedParser.py.ether c:/Program

Help turning code into a module

2005-12-20 Thread dylpkls91
Hi all, I am working on a little program for home automation under the X10 protocol. I have given up using a Palm device for input, so I have resorted to using voice recognition, which I knew nothing about. However, I found a nice little script on the internet that does exactly what I need, and

Re: Help understanding code

2005-04-11 Thread Duncan Booth
Fredrik Lundh wrote: Dhruva Hein wrote: results = pc() === what is the difference between pc and pc()? pc refers to an object, pc() calls it. in this case, it looks like pc is the portal catalog, and calling the catalog returns the contents. Unfortunately there is

Re: Help understanding code

2005-04-11 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : Reading the language tututorial would help you a lot :( === what is the difference between pc and pc()? pc = getToolByName() - returnes a refference to a method Nope. pc is a refference to a method, Nope. pc is not 'a reference to a method', it's a callable

Help understanding code

2005-04-10 Thread Dhruva Hein
Hi. I am trying to understand a section of code written for Plone and I am having problems understanding the Python syntax in a few of the following lines. I'd be grateful if someone could help me understand what's happening in the lines I've marked. I can't see how the dictionary is built or

Re: Help understanding code

2005-04-10 Thread Fredrik Lundh
Dhruva Hein wrote: Hi. I am trying to understand a section of code written for Plone and I am having problems understanding the Python syntax in a few of the following lines. I'd be grateful if someone could help me understand what's happening in the lines I've marked. I can't see how the

Re: Help understanding code

2005-04-10 Thread elbertlev
Reading the language tututorial would help you a lot :( === what is the difference between pc and pc()? pc = getToolByName() - returnes a refference to a method pc is a refference to a method, pc() is a method invocation. numbers =