Re: Using astype(int) for strings with thousand separator

2021-11-15 Thread Mahmood Naderan via Python-list
> (see > https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_csv.html) Got it. Thanks. Regards, Mahmood -- https://mail.python.org/mailman/listinfo/python-list

Re: Using astype(int) for strings with thousand separator

2021-11-14 Thread Thomas Jollans
On 14.11.21 16:41, Mahmood Naderan via Python-list wrote: Hi While reading a csv file, some cells have values like '1,024' which I mean they contains thousand separator ','. Therefore, when I want to process them with   row = df.iloc[0].astype(int) If you are reading a CSV with pandas.read

Re: Using astype(int) for strings with thousand separator

2021-11-14 Thread Barry Scott
> On 14 Nov 2021, at 15:41, Mahmood Naderan via Python-list > wrote: > > Hi > > While reading a csv file, some cells have values like '1,024' which I mean > they contains thousand separator ','. Therefore, when I want to process them > with > > row = df.iloc[0].astype(int) remove the

Using astype(int) for strings with thousand separator

2021-11-14 Thread Mahmood Naderan via Python-list
Hi While reading a csv file, some cells have values like '1,024' which I mean they contains thousand separator ','. Therefore, when I want to process them with   row = df.iloc[0].astype(int) I get the following error   ValueError: invalid literal for int() with base 10: '1,024' How can I fi

Re: =+ for strings

2020-05-03 Thread Dan Sommers
On Sun, 3 May 2020 19:38:06 -0700 (PDT) James Smith wrote: > I tried: > dt=+"{:02d}".format(day) > but I got: > dt=+"{:02d}".format(day) > TypeError: bad operand type for unary +: 'str' > > This works: > dt=dt+"{:02d}".format(day) > > Why can't I do the shortcut on strings? ITYM:

Re: =+ for strings

2020-05-03 Thread Chris Angelico
On Mon, May 4, 2020 at 12:41 PM James Smith wrote: > > I tried: > dt=+"{:02d}".format(day) > but I got: > dt=+"{:02d}".format(day) > TypeError: bad operand type for unary +: 'str' > > This works: > dt=dt+"{:02d}".format(day) > > Why can't I do the shortcut on strings? The shortcut is

=+ for strings

2020-05-03 Thread James Smith
I tried: dt=+"{:02d}".format(day) but I got: dt=+"{:02d}".format(day) TypeError: bad operand type for unary +: 'str' This works: dt=dt+"{:02d}".format(day) Why can't I do the shortcut on strings? -- https://mail.python.org/mailman/listinfo/python-list

Re: sort order for strings of digits

2012-11-01 Thread Steven D'Aprano
On Thu, 01 Nov 2012 11:53:06 +1100, Chris Angelico wrote: > On Thu, Nov 1, 2012 at 10:44 AM, Steven D'Aprano > wrote: >> On the contrary. If you are using cmp with sort, your sorts are slow, >> and you should upgrade to using a key function as soon as possible. >> >> > But cmp_to_key doesn't actu

Re: sort order for strings of digits

2012-11-01 Thread wxjmfauth
Le mercredi 31 octobre 2012 16:17:19 UTC+1, djc a écrit : > I learn lots of useful things from the list, some not always welcome. No > > sooner had I found a solution to a minor inconvenience in my code, than > > a recent thread here drew my attention to the fact that it will not work > > for

Re: sort order for strings of digits

2012-10-31 Thread Arnaud Delobelle
On 31 October 2012 23:09, Steven D'Aprano wrote: > The trick is to take each string and split it into a leading number and a > trailing alphanumeric string. Either part may be "empty". Here's a pure > Python solution: > > from sys import maxsize # use maxint in Python 2 > def split(s): > for

Re: sort order for strings of digits

2012-10-31 Thread Chris Angelico
On Thu, Nov 1, 2012 at 10:44 AM, Steven D'Aprano wrote: > On the contrary. If you are using cmp with sort, your sorts are slow, and > you should upgrade to using a key function as soon as possible. > But cmp_to_key doesn't actually improve anything. So I'm not sure how Py3 has achieved anything;

Re: sort order for strings of digits

2012-10-31 Thread Mark Lawrence
On 31/10/2012 22:24, Ian Kelly wrote: On Wed, Oct 31, 2012 at 3:33 PM, Mark Lawrence wrote: Nope. I'm busy porting my own code from 2.7 to 3.3 and cmp seems to be very dead. This doesn't help either. c:\Users\Mark\Cash\Python>**2to3.py Traceback (most recent call last): File "C:\Python33

Re: sort order for strings of digits

2012-10-31 Thread DJC
On 31/10/12 23:09, Steven D'Aprano wrote: On Wed, 31 Oct 2012 15:17:14 +, djc wrote: The best I can think of is to split the input sequence into two lists, sort each and then join them. According to your example code, you don't have to split the input because you already have two lists, o

Re: sort order for strings of digits

2012-10-31 Thread Steven D'Aprano
On Wed, 31 Oct 2012 19:05:17 -0400, Dennis Lee Bieber wrote: >> The cmp builtin is also gone. If you need it, the suggested >> replacement for "cmp(a, b)" is "(b < a) - (a < b)". >> > OUCH... Just another reason for my to hang onto the 2.x series as > long as possible On the contrary. If

Re: sort order for strings of digits

2012-10-31 Thread Steven D'Aprano
On Wed, 31 Oct 2012 15:17:14 +, djc wrote: > The best I can think of is to split the input sequence into two lists, > sort each and then join them. According to your example code, you don't have to split the input because you already have two lists, one filled with numbers and one filled wit

Re: sort order for strings of digits

2012-10-31 Thread Ian Kelly
On Wed, Oct 31, 2012 at 3:33 PM, Mark Lawrence wrote: > Nope. I'm busy porting my own code from 2.7 to 3.3 and cmp seems to be > very dead. > > This doesn't help either. > > c:\Users\Mark\Cash\Python>**2to3.py > > Traceback (most recent call last): > File "C:\Python33\Tools\Scripts\**2to3.py",

Re: sort order for strings of digits

2012-10-31 Thread Mark Lawrence
On 31/10/2012 18:17, Dennis Lee Bieber wrote: Why -- I doubt Python 3.x .sort() and sorted() have removed the optional key and cmp keywords. Nope. I'm busy porting my own code from 2.7 to 3.3 and cmp seems to be very dead. This doesn't help either. c:\Users\Mark\Cash\Python>2to3.

Re: sort order for strings of digits

2012-10-31 Thread Ian Kelly
On Wed, Oct 31, 2012 at 9:17 AM, djc wrote: > The best I can think of is to split the input sequence into two lists, sort > each and then join them. In the example you have given they already seem to be split, so you could just do: sorted(n, key=int) + sorted(s) If that's not really the case, t

Re: sort order for strings of digits

2012-10-31 Thread Hans Mulder
On 31/10/12 16:17:14, djc wrote: > Python 3.2.3 (default, Oct 19 2012, 19:53:16) > sorted(n+s) > ['1', '10', '101', '13', '1a', '2', '2000', '222 bb', '3', '31', '40', > 'a', 'a1', 'ab', 'acd', 'b a 4', 'bcd'] > sorted(int(x) if x.isdigit() else x for x in n+s) > Traceback (most recent

sort order for strings of digits

2012-10-31 Thread djc
I learn lots of useful things from the list, some not always welcome. No sooner had I found a solution to a minor inconvenience in my code, than a recent thread here drew my attention to the fact that it will not work for python 3. So suggestions please: TODO 2012-10-22: sort order numbers

Re: gettext compatible, public domain collections of translations for strings commonly used in software applications?

2010-05-21 Thread Steven D'Aprano
On Fri, 21 May 2010 18:01:58 -0400, python wrote: > It seems to me that there must be some public domain collection of > translated strings that could be searched for 1:1 or fuzzy translations > for strings commonly used in software applications? There must be? Is that a law of

gettext compatible, public domain collections of translations for strings commonly used in software applications?

2010-05-21 Thread python
It seems to me that there must be some public domain collection of translated strings that could be searched for 1:1 or fuzzy translations for strings commonly used in software applications? Is there a technical and copyright friendly (LGPL licensed?) way to query services like Google&#

Re: How is the logical processing being done for strings like 'Dog' and 'Cat'

2008-10-20 Thread Tim Roberts
Sumitava Mukherjee <[EMAIL PROTECTED]> wrote: >Hi all, >I am a novice programmer in Python. >Please could you explain me the results (regarding logical operators). > >I get this: > print bool('God' and 'Devil') >True > >[This is ok because (any) string is True, so; (True and True) gives >True

Re: How is the logical processing being done for strings like 'Dog' and 'Cat'

2008-10-20 Thread Steven D'Aprano
On Mon, 20 Oct 2008 18:41:23 -0700, Sumitava Mukherjee wrote: > What is python doing when we type in ('God' and 'Devil') or key in (01 > and 10) ? There are two important things you need to know: (1) All Python objects have a boolean context. (2) Python's boolean operators are short-circuit op

Re: How is the logical processing being done for strings like 'Dog' and 'Cat'

2008-10-20 Thread zaarg
On Oct 20, 9:41 pm, Sumitava Mukherjee <[EMAIL PROTECTED]> wrote: > Hi all, > I am a novice programmer in Python. > Please could you explain me the results (regarding logical operators). > > I get this: > > >>> print bool('God' and 'Devil') > > True > > [This is ok because (any) string is True, Not

Re: How is the logical processing being done for strings like 'Dog' and 'Cat'

2008-10-20 Thread Benjamin
On Oct 20, 8:41 pm, Sumitava Mukherjee <[EMAIL PROTECTED]> wrote: > Hi all, > I am a novice programmer in Python. > Please could you explain me the results (regarding logical operators). > > I get this: > > >>> print bool('God' and 'Devil') > > True > > [This is ok because (any) string is True, so;

How is the logical processing being done for strings like 'Dog' and 'Cat'

2008-10-20 Thread Sumitava Mukherjee
Hi all, I am a novice programmer in Python. Please could you explain me the results (regarding logical operators). I get this: >>> print bool('God' and 'Devil') True [This is ok because (any) string is True, so; (True and True) gives True] >>> print('God' and 'Devil') Devil [This is what I d

Re: Newbi Q: What is a rational for strings not being lists in Python?

2007-10-16 Thread Paul McGuire
On Oct 15, 3:03 pm, "Matt McCredie" <[EMAIL PROTECTED]> wrote: > So, the best way to get the posted > code to work [...] is to cast the input parameter to a list first. > >>> s = "I am a string" > >>> x = list(s) > >>> x > > ['I', ' ', 'a', 'm', ' ', 'a', ' ', 's', 't', 'r', 'i', 'n', 'g'] >>> "

Re: Newbi Q: What is a rational for strings not being lists in Python?

2007-10-16 Thread Neil Cerutti
On 2007-10-16, Simon Brunning <[EMAIL PROTECTED]> wrote: > On 10/16/07, Benjamin <[EMAIL PROTECTED]> wrote: > >> Good explanation, but basically strings are immutable so they can be >> used in dicts. > > Nope. Value types should always be immutable. > >

Re: Newbi Q: What is a rational for strings not being lists in Python?

2007-10-16 Thread Simon Brunning
On 10/16/07, Benjamin <[EMAIL PROTECTED]> wrote: > Good explanation, but basically strings are immutable so they can be > used in dicts. Nope. Value types should always be immutable. -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunnin

Re: Newbi Q: What is a rational for strings not being lists in Python?

2007-10-16 Thread Dmitri O.Kondratiev
ve mutable lists along with immutable strings. So answer to my question "What is a rational for strings not being lists in Python?" is quite trivial, as Simon B. ([EMAIL PROTECTED]) <[EMAIL PROTECTED]>wrote: "Lists are mutable, strings are not, so so strings can't support all

Re: Newbi Q: What is a rational for strings not being lists in Python?

2007-10-15 Thread Benjamin
f elements, where element is a char is > > that all list functions will work *without any modifications* on strings as > > well as on other types of lists. > > So, I am trying to understand: what is a rational for strings not being > > lists in Python? > > > Thanks, > &

Re: Newbi Q: What is a rational for strings not being lists in Python?

2007-10-15 Thread Matt McCredie
other types of lists. > So, I am trying to understand: what is a rational for strings not being > lists in Python? > > Thanks, > -- > Dmitri O. Kondratiev > [EMAIL PROTECTED] > http://www.geocities.com/dkondr > > On 10/15/07, Dmitri O.Kondratiev <[EMAIL PROTECTED]>

Re: Newbi Q: What is a rational for strings not being lists in Python?

2007-10-15 Thread Neil Cerutti
On 2007-10-15, Simon Brunning <[EMAIL PROTECTED]> wrote: > On 10/15/07, Dmitri O.Kondratiev <[EMAIL PROTECTED]> wrote: >> To clarify my point: >> reverse() is a lucky one - Python has variants of *this particular* >> function both for lists and strings. Yet what about other list functions? >> Ho

Re: Newbi Q: What is a rational for strings not being lists in Python?

2007-10-15 Thread Simon Brunning
On 10/15/07, Dmitri O.Kondratiev <[EMAIL PROTECTED]> wrote: > To clarify my point: > reverse() is a lucky one - Python has variants of *this particular* > function both for lists and strings. Yet what about other list functions? > How in general, can I write a function that works both on list a

Newbi Q: What is a rational for strings not being lists in Python?

2007-10-15 Thread Dmitri O.Kondratiev
subtype of a list then? The advantage of string being a list of elements, where element is a char is that all list functions will work *without any modifications* on strings as well as on other types of lists. So, I am trying to understand: what is a rational for strings not being lists in Python

Re: py3k - format specifier for strings

2007-09-03 Thread Martin v. Löwis
a = "{0}".format(5.66) a > '5.66' > > There are more options in PEP 3101 (fill, alignment, etc.), but I'm having > trouble implementing them. It would be good if you could describe these troubles in more detail. What have you been trying, what happened, and what did you expect to happen

py3k - format specifier for strings

2007-09-03 Thread Carl Trachte
Hello. Python 3.0.a1 has been released. I'm trying to get the hang of the new string formatting in the form: >>> a = "{0}".format(5.66) >>> a '5.66' There are more options in PEP 3101 (fill, alignment, etc.), but I'm having trouble implementing them. The doc has not yet been written. I haven't

Re: Boost Python properties/getter functions for strings

2007-03-19 Thread Shawn McGrath
On Mar 19, 12:49 pm, "Jon Clements" <[EMAIL PROTECTED]> wrote: > On 19 Mar, 16:40, "Shawn McGrath" <[EMAIL PROTECTED]> wrote: > > > On Mar 19, 12:00 pm, "Shawn McGrath" <[EMAIL PROTECTED]> wrote: > > > > I forgot to mention, getname is defined as: > > > const std::string &Entity::getName() const;

Re: Boost Python properties/getter functions for strings

2007-03-19 Thread Jon Clements
On 19 Mar, 16:40, "Shawn McGrath" <[EMAIL PROTECTED]> wrote: > On Mar 19, 12:00 pm, "Shawn McGrath" <[EMAIL PROTECTED]> wrote: > > > I forgot to mention, getname is defined as: > > const std::string &Entity::getName() const; > > After more reading I found the copy_const_reference, and replaced: >

Re: Boost Python properties/getter functions for strings

2007-03-19 Thread Shawn McGrath
On Mar 19, 12:00 pm, "Shawn McGrath" <[EMAIL PROTECTED]> wrote: > I forgot to mention, getname is defined as: > const std::string &Entity::getName() const; After more reading I found the copy_const_reference, and replaced: boost::python::return_internal_reference<>()); with: boost::python::ret

Re: Boost Python properties/getter functions for strings

2007-03-19 Thread Shawn McGrath
I forgot to mention, getname is defined as: const std::string &Entity::getName() const; -- http://mail.python.org/mailman/listinfo/python-list

Boost Python properties/getter functions for strings

2007-03-19 Thread Shawn McGrath
Hi, I'm trying to expose a C++ class' internals to python via boost::python. I can do integer/boolean functions fine, but as soon as I do a string get/set it craps out. boost::python::class_ >("Entity") //publics .def("isActive", &Entity::isActive) //bool

Re: Unicode formatting for Strings

2007-02-05 Thread John Machin
On Feb 6, 8:05 am, [EMAIL PROTECTED] wrote: > On Feb 5, 7:00 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > > > > On 2/5/07, Kent Johnson <[EMAIL PROTECTED]> wrote: > > > > [EMAIL PROTECTED] wrote: > > > > Hi, > > > > > I´m trying desperately to tell the interpreter to put an 'á' in my > > > > s

Re: Unicode formatting for Strings

2007-02-05 Thread robson . cozendey . rj
On Feb 5, 7:00 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On 2/5/07, Kent Johnson <[EMAIL PROTECTED]> wrote: > > > > > > > [EMAIL PROTECTED] wrote: > > > Hi, > > > > I´m trying desperately to tell the interpreter to put an 'á' in my > > > string, so here is the code snippet: > > > > # -*- codi

Re: Unicode formatting for Strings

2007-02-05 Thread Chris Mellon
On 2/5/07, Kent Johnson <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hi, > > > > I´m trying desperately to tell the interpreter to put an 'á' in my > > string, so here is the code snippet: > > > > # -*- coding: utf-8 -*- > > filename = u"Ataris Aquáticos #2.txt" > > f = open(filename,

Re: Unicode formatting for Strings

2007-02-05 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > Hi, > > I´m trying desperately to tell the interpreter to put an 'á' in my > string, so here is the code snippet: > > # -*- coding: utf-8 -*- > filename = u"Ataris Aquáticos #2.txt" > f = open(filename, 'w') > > Then I save it with Windows Notepad, in the UTF-8 format.

Re: Unicode formatting for Strings

2007-02-05 Thread kyosohma
On Feb 5, 11:55 am, [EMAIL PROTECTED] wrote: > Hi, > > I´m trying desperately to tell the interpreter to put an 'á' in my > string, so here is the code snippet: > > # -*- coding: utf-8 -*- > filename = u"Ataris Aquáticos #2.txt" > f = open(filename, 'w') > > Then I save it with Windows Notepad, in

Unicode formatting for Strings

2007-02-05 Thread robson . cozendey . rj
Hi, I´m trying desperately to tell the interpreter to put an 'á' in my string, so here is the code snippet: # -*- coding: utf-8 -*- filename = u"Ataris Aquáticos #2.txt" f = open(filename, 'w') Then I save it with Windows Notepad, in the UTF-8 format. So: 1) I put the "magic comment" at the sta

Re: searching for strings (in a tuple) in a string

2006-07-14 Thread Simon Forman
Simon Forman wrote: ... > I usually use this with assert statements when I need to check a > sequence. Rather than: > > for something in something_else: assert expression > > I say > > assert False not in (expression for something in something_else) > > This way the whole assert statement will be r

Re: searching for strings (in a tuple) in a string

2006-07-07 Thread Steven D'Aprano
tem in tup if item in a]: print "Some items found." else: print "No items found." Or, you can use filter: a = 'xfsdfyysd asd x' tup = ('x','yy','asd') if filter(lambda item, a=a: item in a, tup): print "Some items

Re: searching for strings (in a tuple) in a string

2006-07-06 Thread Simon Forman
manstey wrote: > Hi, > > I often use: > > a='yy' > tup=('x','yy','asd') > if a in tup: ><...> > > but I can't find an equivalent code for: > > a='xfsdfyysd asd x' > tup=('x','yy','asd') > if tup in a: >< ...> > > I can only do: > > if 'x' in a or 'yy' in a or 'asd' in a: ><...> > > but

Re: searching for strings (in a tuple) in a string

2006-07-06 Thread Fredrik Lundh
"manstey" <[EMAIL PROTECTED]> wrote: >I know I can do it this way. I wanted to know if there was another way. if you don't want to write Python programs, why are you using Python ? -- http://mail.python.org/mailman/listinfo/python-list

Re: searching for strings (in a tuple) in a string

2006-07-06 Thread manstey
I know I can do it this way. I wanted to know if there was another way. Fredrik Lundh wrote: > "manstey" <[EMAIL PROTECTED]> wrote: > > > but I can't find an equivalent code for: > > > > a='xfsdfyysd asd x' > > tup=('x','yy','asd') > > if tup in a: > > < ...> > > > > I can only do: > > > > if 'x

Re: searching for strings (in a tuple) in a string

2006-07-06 Thread Fredrik Lundh
"manstey" <[EMAIL PROTECTED]> wrote: > but I can't find an equivalent code for: > > a='xfsdfyysd asd x' > tup=('x','yy','asd') > if tup in a: > < ...> > > I can only do: > > if 'x' in a or 'yy' in a or 'asd' in a: > <...> > > but then I can't make the if clause dependent on changing value of t

Re: searching for strings (in a tuple) in a string

2006-07-06 Thread [EMAIL PROTECTED]
You can get the matching elements with a list comprehension with something like py> a='xfsdfyysd asd x' py> tup=('x','yy','asd') py> [x for x in tup if x in a.split()] ['x', 'asd'] Hope this helps manstey wrote: > Hi, > > I often use: > > a='yy' > tup=('x','yy','asd') > if a in tup: ><...> >

searching for strings (in a tuple) in a string

2006-07-06 Thread manstey
Hi, I often use: a='yy' tup=('x','yy','asd') if a in tup: <...> but I can't find an equivalent code for: a='xfsdfyysd asd x' tup=('x','yy','asd') if tup in a: < ...> I can only do: if 'x' in a or 'yy' in a or 'asd' in a: <...> but then I can't make the if clause dependent on changin

Re: slicing functionality for strings / Python suitabilityforbioinformatics

2005-09-21 Thread Tom Anderson
On Wed, 21 Sep 2005, Fredrik Lundh wrote: > Tom Anderson wrote: > >> There's a special hell for people who override builtins. > > which is, most likely, chock full of highly experienced python > programmers. You reckon? I've never felt the need to do it myself, and instinctively, it seems like

Re: slicing functionality for strings / Python suitability forbioinformatics

2005-09-21 Thread Steven D'Aprano
On Wed, 21 Sep 2005 11:37:38 +0100, Tom Anderson wrote: > There's a special hell for people who override builtins. [slaps head] Of course there is, and I will burn in it for ever... -- Steven. -- http://mail.python.org/mailman/listinfo/python-list

Re: slicing functionality for strings / Python suitabilityforbioinformatics

2005-09-21 Thread Fredrik Lundh
Tom Anderson wrote: > There's a special hell for people who override builtins. which is, most likely, chock full of highly experienced python programmers. -- http://mail.python.org/mailman/listinfo/python-list

Re: slicing functionality for strings / Python suitability forbioinformatics

2005-09-21 Thread Tom Anderson
On Wed, 21 Sep 2005, Steven D'Aprano wrote: > On Mon, 19 Sep 2005 19:40:12 -0700, jbperez808 wrote: > >> Having to do an array.array('c',...): >> >> >>> x=array.array('c','ATCTGACGTC') >> >>> x[1:9:2]=array.array('c','') >> >>> x.tostring() >> 'AACAGACATC' >> >> is a bit klunkier than one

Re: slicing functionality for strings / Python suitability forbioinformatics

2005-09-20 Thread Steven D'Aprano
On Mon, 19 Sep 2005 19:40:12 -0700, jbperez808 wrote: > Having to do an array.array('c',...): > > >>> x=array.array('c','ATCTGACGTC') > >>> x[1:9:2]=array.array('c','') > >>> x.tostring() > 'AACAGACATC' > > is a bit klunkier than one would want, but I guess > the efficient performanc

Re: slicing functionality for strings / Python suitability forbioinformatics

2005-09-19 Thread jbperez808
Great suggestion... I was naively trying to turn the string into a list and slice that which I reckon would be significantly slower. -- http://mail.python.org/mailman/listinfo/python-list

Re: slicing functionality for strings / Python suitability for bioinformatics

2005-09-19 Thread Sebastian Bassi
On 19 Sep 2005 12:25:16 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >>> rs='AUGCUAGACGUGGAGUAG' > >>> rs[12:15]='GAG' > Traceback (most recent call last): > File "", line 1, in ? > rs[12:15]='GAG' > TypeError: object doesn't support slice assignment You should try Biopython (www.bi

Re: slicing functionality for strings / Python suitability forbioinformatics

2005-09-19 Thread jbperez808
Having to do an array.array('c',...): >>> x=array.array('c','ATCTGACGTC') >>> x[1:9:2]=array.array('c','') >>> x.tostring() 'AACAGACATC' is a bit klunkier than one would want, but I guess the efficient performance is the silver lining here. -- http://mail.python.org/mailman/listinfo

Re: slicing functionality for strings / Python suitability for bioinformatics

2005-09-19 Thread jbperez808
right, i forgot about that... -- http://mail.python.org/mailman/listinfo/python-list

Re: slicing functionality for strings / Python suitability forbioinformatics

2005-09-19 Thread Terry Reedy
"Reinhold Birkenfeld" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > [EMAIL PROTECTED] wrote: > rs='AUGCUAGACGUGGAGUAG' > rs[12:15]='GAG' >> Traceback (most recent call last): >> File "", line 1, in ? >> rs[12:15]='GAG' >> TypeError: object doesn't support slice assig

Re: slicing functionality for strings / Python suitability for bioinformatics

2005-09-19 Thread Reinhold Birkenfeld
[EMAIL PROTECTED] wrote: rs='AUGCUAGACGUGGAGUAG' rs[12:15]='GAG' > Traceback (most recent call last): > File "", line 1, in ? > rs[12:15]='GAG' > TypeError: object doesn't support slice assignment > > You can't assign to a section of a sliced string in > Python 2.3 and there doesn'

slicing functionality for strings / Python suitability for bioinformatics

2005-09-19 Thread jbperez808
>>> rs='AUGCUAGACGUGGAGUAG' >>> rs[12:15]='GAG' Traceback (most recent call last): File "", line 1, in ? rs[12:15]='GAG' TypeError: object doesn't support slice assignment You can't assign to a section of a sliced string in Python 2.3 and there doesn't seem to be mention of this as a Python