I was able to read the data from file into a two dimensional array (lists) rows=[map(float,line.split())for line in file("data")] but How to write them back into the file. Thank you, srikanth