Hi,
I have a string as str='123ACTGAAC'.
I need to extract the numeric part from the alphabetic part which I
did using
numer=re.findall(r'\d+',str)
numer
123
To get the alphabetic part, I could do
alpha=str.replace('123','')
alpha
ACTGAAC
But when I give
Sandhya Prabhakaran sandhyaprabhaka...@gmail.com writes:
Hi,
I have a string as str='123ACTGAAC'.
I need to extract the numeric part from the alphabetic part which I
did using
numer=re.findall(r'\d+',str)
numer
123
To get the alphabetic part, I could do
alpha=str.replace('123','')
alpha
Sandhya Prabhakaran wrote:
Hi,
I have a string as str='123ACTGAAC'.
I need to extract the numeric part from the alphabetic part which I
did using
numer=re.findall(r'\d+',str)
numer
123
[snip]
I get:
['123']
which is a _list_ of the strings found.
--
On Mon, Aug 3, 2009 at 8:47 PM, Sandhya
Prabhakaransandhyaprabhaka...@gmail.com wrote:
Hi,
I have a string as str='123ACTGAAC'.
I need to extract the numeric part from the alphabetic part which I
did using
numer=re.findall(r'\d+',str)
numer
123
The docs for re.findall say that it returns
Oh yes indeed!
Now that works :D
Thanks a lot !!
2009/8/3 Kushal Kumaran
kushal.kumaran+pyt...@gmail.comkushal.kumaran%2bpyt...@gmail.com
On Mon, Aug 3, 2009 at 8:47 PM, Sandhya
Prabhakaransandhyaprabhaka...@gmail.com wrote:
Hi,
I have a string as str='123ACTGAAC'.
I need