Hello all,
i was working on an R script that will read a huge text file and make some calculation inside it, but i figured out that it will need long time to do the job , so i'm trying to convert it into python.
is there any way to do this automatically ? because i'm having some troubles making the conversion line by line.
that's the code if someone can help.
this script will calculate 3 values : A,Cres and mb for each (p,q) wich is the line index pair.
tab=read.table(test.txt,sep=" ")
tab$value =((tab$V3+tab$V4)/(tab$V2+tab$V1))
re=NULL
rowsnb=nrow(tab)
for(q in seq(1,rowsnb,by=150)) {
for(p in seq(1,rowsnb,by=150)) {
A=(rowsnb*(q^2))
for(i in 1:q) {
Cres=(tab[i,]$value)*i
}
mb=((rowsnb*A)/Cres)*A
final <- rbind(final, data.frame(avalue=A,Cvalue=Cres,mbvalue=mb))
}
}
write.delim(final, file = "final.txt", row.names = TRUE, quote = FALSE, sep = " ")
thanks for help