[Tutor] attribute error --Disregard
Sara Johnson
sarliz73 at yahoo.com
Sun Jul 29 06:48:46 CEST 2007
Disregard this post. Sorry for the added message in everyone's inbox.
----- Original Message ----
From: Sara Johnson <sarliz73 at yahoo.com>
To: Python <tutor at python.org>
Sent: Saturday, July 28, 2007 11:19:15 PM
Subject: Re: [Tutor] attribute error
I scrapped that other attempt. I keep hitting brick walls.
However, is there an indentation error here? I may just be too frustrated to see it.
for key in skeys:
fracmiss=1.*numberMissing(z[key].values())/nsites #note decimal multiplication, 1.*
outstring="%s has %4.1f%% missing" % (key,100*fracmiss)
if fracmiss>0.:
print outstring
----- Original Message ----
From: Bob Gailer <bgailer at alum.rpi.edu>
To: Sara Johnson <sarliz73 at gmail.com>
Cc: Python <tutor at python.org>
Sent: Saturday, July 28, 2007 10:14:58 PM
Subject: Re: [Tutor] attribute error
Sara Johnson wrote:
> I thought 'sort()' was a function you could use as long as the dict or
> key had some value. When is this not right?
Please give us some context for the question. Code fragment, traceback.
sort is a method of mutable sequence types (lists, ...)
myList = [1, 3, 2]
myList.sort() # returns None
print myList
[1, 2, 3]
--
Bob Gailer
510-978-4454 Oakland, CA
919-636-4239 Chapel Hill, NC
_______________________________________________
Tutor maillist - Tutor at python.org
http://mail.python.org/mailman/listinfo/tutor
Shape Yahoo! in your own image. Join our Network Research Panel today!
____________________________________________________________________________________
Pinpoint customers who are looking for what you sell.
http://searchmarketing.yahoo.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070728/449cc743/attachment.html
More information about the Tutor
mailing list