[Tutor] quick data structures question

Fred G bayespokerguy at gmail.com
Wed Sep 21 05:28:43 CEST 2011

Hey guys,

I want to write a short script that takes from an input excel file w/ a
bunch of rows and columns.  The two columns I'm interested in are "high
gains" and "genes."  I want the user to write:

>>>Which genes are associated with gains over 20%?

and then I want the script to search through the excel file, find in the
"high gains" column when the number is greater than 20%, and then store the
corresponding genes in that row (but in the "genes" column).  I know this
should be super simple, but I'm having trouble breaking the problem into
smaller, manageable pieces.  For instance, the "high gains" column does not
have just integers, it is in the format YYYY%.  Also, I'd like for the final
script to be usable in R if possible, too.

pseudocode is something like this:

for line in lines:
  if item in "high gains" > 20
     create new dictionary
       store genes from "genes" into new dictionary

Much thanks in advance!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110920/c8de2c19/attachment-0001.html>

More information about the Tutor mailing list