Re: [Tutor] Translating R Code to Python-- reading in csv files, writing out to csv files

2012-05-19 Thread Martin A. Brown
Benjamin, : Thanks Martin-- this is really great. My major question now is : that I need to transition to Python for a project and I need to : learn how to think in Python instead of in R. The two strategies : I have used so far are: a) going through the description and : exercises in

Re: [Tutor] Translating R Code to Python-- reading in csv files, writing out to csv files

2012-05-19 Thread Benjamin G
Thanks Martin-- this is really great. My major question now is that I need to transition to Python for a project and I need to learn how to think in Python instead of in R. The two strategies I have used so far are: a) going through the description and exercises in http://www.openbookproject.net/

Re: [Tutor] Translating R Code to Python-- reading in csv files, writing out to csv files

2012-05-19 Thread Martin A. Brown
Greetings Benjamin, To begin: I do not know R. : I'm trying to improve my python by translating R code that I : wrote into Python. : : *All I am trying to do is take in a specific column in : "uncurated" and write that whole column as output to "curated." : It should be a pretty basic

Re: [Tutor] Translating R Code to Python-- reading in csv files, writing out to csv files

2012-05-19 Thread Benjamin G
Thanks, Joel. Here is a simple example of the input data (top row is column headers in the input file) Patient ID Sample Type Survival Time(months) unique_patient_ID1Tumor 12 unique_patient_ID2Normal 5 unique_patient_I

Re: [Tutor] Translating R Code to Python-- reading in csv files, writing out to csv files

2012-05-19 Thread Joel Goldstick
On Sat, May 19, 2012 at 1:58 PM, wrote: > I confese I haven't read your entire email, but have you looked at pyR? I > believe it is a wrapper for python, giiving you access to r. > > > Sent from my Verizon Wireless BlackBerry > > -Original Message- > From: Benjamin G > Sender: tutor-bou

Re: [Tutor] Translating R Code to Python-- reading in csv files, writing out to csv files

2012-05-19 Thread eire1130
I confese I haven't read your entire email, but have you looked at pyR? I believe it is a wrapper for python, giiving you access to r. Sent from my Verizon Wireless BlackBerry -Original Message- From: Benjamin G Sender: tutor-bounces+eire1130=gmail@python.org Date: Sat, 19 May 2012

[Tutor] Translating R Code to Python-- reading in csv files, writing out to csv files

2012-05-19 Thread Benjamin G
I'm trying to improve my python by translating R code that I wrote into Python. I've been reading about the python csv module and realized it was best to get some expert input to clarify some confusion on my part. As background, GSEX_full_pdata.csv has different patient information (such as u

Re: [Tutor] Parsing data from a set of files iteratively

2012-05-19 Thread Alan Gauld
On 19/05/12 12:42, Spyros Charonis wrote: I have tried the following two snippets which both results in the same error import os, glob os.chdir('users/spyros/desktop/3NY8MODELSHUMAN/') homology_models = glob.glob('*.pdb') for i in range(len(homology_models)): python serialize_PIPELINE_mo

Re: [Tutor] Parsing data from a set of files iteratively

2012-05-19 Thread Spyros Charonis
I have tried the following two snippets which both results in the same error import os, glob os.chdir('users/spyros/desktop/3NY8MODELSHUMAN/') homology_models = glob.glob('*.pdb') for i in range(len(homology_models)): python serialize_PIPELINE_models.py homology_models[i] import os, sys path = "/