Hi, I'm new to python and I have read through the tutorial on: http://docs.python.org/tutorial/index.html which was really good, but I have been an R user for 7 years and and am finding it difficult to do even basic things in python, for example I want to import my data (a tab-delimited .txt file) so that I can index and select a random sample of one column based on another column. my data has 2 columns named 'area' and 'change.dens'.
In R I would just data<-read.table("FILE PATH\\Road.density.municipio.all.txt", header=T) #header =T gives colums their headings so that I can call each individually names(data) attach(data) Then to Index I would simply: subset<-change.dens[area<2000&area>700] # so return change.dens values that have corresponding 'area's of between 700 and 2000 then to randomly sample a value from that I just need to random<-sample(subset,1) My question is how do I get python to do this??? Sorry I know it is very basic but I just cant seem to get going, Thank you K.
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor