[BioPython] Count

Iddo Friedberg idoerg at burnham.org
Thu May 6 12:59:00 EDT 2004


I guess the Pasteur Institute pages need updating, count() is a sequence 
method, not a function. Thus instead of:

 >>> count(se, 'g')


use:

 >>> se.count('g')


Iddo

Carlos Manuel Estévez-Bretón wrote:
> Hi People!
> 
> I'm new in the list, (also in Python)
> 
> I have a tutorial of python for Biologists, from Pasteur Institute, in 
> it is an example that use "count" command, but i'm having an error of 
> not command not defined..
> 
> Could some one help this newby?
> 
> 
> _______
> [Paradox:karel/Desktop/egenix-mx-base-2.0.5] karel# python
> Python 2.3 (#1, Sep 13 2003, 00:49:11)
> [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>  >>> se = 'sgggggggggggggggggkljkljdiujdoiaudoiasud'
>  >>> se
> 'sgggggggggggggggggkljkljdiujdoiaudoiasud'
>  >>> long se
>  >>> a = len(se)
>  >>> a
> 40
>  >>> b = count(se, 'g')
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> NameError: name 'count' is not defined
> 
> _______________________________
> Carlos Manuel Estévez-Bretón R.
> 
> Coordinador Unidad Sistemas
> Facultad de Ciencias
> Pontificia Universidad Javeriana
> 
> Tel.(571) 320 8320 Ext.4033/32/75
> El 06/05/2004, a las 11:11, Brad Chapman escribió:
> 
> 
> _______________________________________________
> BioPython mailing list  -  BioPython at biopython.org
> http://biopython.org/mailman/listinfo/biopython
> 
> 

-- 
Iddo Friedberg, Ph.D.
The Burnham Institute
10901 N. Torrey Pines Rd.
La Jolla, CA 92037
USA
Tel: +1 (858) 646 3100 x3516
Fax: +1 (858) 713 9930
http://ffas.ljcrf.edu/~iddo


More information about the BioPython mailing list