I have a very huge xyz coordinates file as below:
C -0.847463930 1.503191118 0.986935030
N -0.849494834 0.360945118 1.290183500
- - - -
- - - -
- - - -
- - - -
C -0.409837378 -0.781300882 0.986935030
C -0.474783893 -0.837401882 -0.407860970
H -0.679839030 0.360945118 -2.206546970
I read this file using numpy (in following script I use list method) array with first column corresponds to x, second y, and third z. Now I want to write python code to subtract rows like the following fashion: 100th -1st, 200th - 101th, 300th-201th and so on till the end. I have tried to iterate over the rows with 100 gap but end with no luck. Are there someone to give me an idea?
filename = 'file.xyz'
xyz = open(filename, 'r')
atoms = []
coordinates = []
xyz.readline()
xyz.readline()
for line in xyz:
atom, x, y, z = line.split()
atoms.append(atom)
coordinates.append([float(x), float(y), float(z)])
# iterate over rows
'''How can I do the iteration?'''