I have a a big file (called Data) that is a list of strings, its 175693 lines but i only want to work with lines 8 to 151799. An abbreviated version of the file follows:
Name Group Measured Modelled Residual Weight
pdwl1 pdwls 2083.620 2089.673 -6.052805 9.4067000E-04
pdwl2 pdwls 2186.748 2199.771 -13.02284 8.9630800E-04
pdwl3 pdwls 2150.983 2160.259 -9.275730 9.1121100E-04
pdwl4 pdwls 2133.283 2142.970 -9.686504 9.1877100E-04
pdwl5 pdwls 2241.741 1769.331 472.4097 8.7432100E-04
pst_1 devwls 2191.200 2094.658 96.54200 1.000000
pst_2 devwls 2194.160 2094.070 100.0900 1.000000
pst_3 devwls 2190.790 2093.375 97.41500 1.000000
pst_4 devwls 2191.700 2092.671 99.02900 1.000000
pst_5 devwls 2188.260 2092.739 95.52100 1.000000
devfl1 devflux 1.2788475E+07 1.2199410E+07 589064.6 1.4030900E-06
devfl2 devflux 1.2208086E+07 1.2044727E+07 163359.4 1.4030900E-06
devfl3 devflux 1.3559062E+07 1.1423958E+07 2135104. 1.4030900E-06
devfl4 devflux 1.2419465E+07 1.1141419E+07 1278046. 1.4030900E-06
devfl5 devflux 1.2070242E+07 1.0925833E+07 1144409. 1.4030900E-06
I need to plot measured values versus modelled values, I want one plot for measured v modeled for Group==pdwls, another plot for measured v residual for Group==pdwls, then for meas v modeled fro Group == devwls and a plot for meas v residual for devwls
Here is what i have
import numpy as np
import matplotlib.pyplot as plt
data = np.genfromtxt('elm3_1-4 - Copy.rei', dtype=None, names=True)
#data = np.genfromtxt('elm3_1-4-pdwls.rei', dtype=None, names=True)
#data = np.genfromtxt('elm3_1-4-devwls.rei', dtype=None, names=True)
for data[6:1643] in data:
plt.subplot(2,2,1)
plt.scatter(data['Measured'], data['Modelled'])
plt.xlabel('Measured (ft)')
plt.ylabel('Modelled (ft)')
plt.title('ELM3_1-4 Pre-Development WLs')
plt.xlim(1000,4000)
plt.ylim(-2000,4000)
plt.scatter(data['Measured'], data['Residual'])
plt.xlabel('Measured (ft)')
plt.ylabel('Residual (Meas - Model) (ft)')
plt.title('ELM3_1-4 Pre-Development: Measured WLs v Resduals')
plt.xlim(1000,4000)
plt.ylim(-1000,1000)
plt.subplot(2,2,2)
plt.show()
for data[1644:151798] in data:
plt.subplot(2,2,3)
plt.scatter(data['Measured'], data['Modelled'])
plt.xlabel('Measured (ft)')
plt.ylabel('Modelled (ft)')
plt.title('ELM3_1-4 Development WLs')
plt.xlim(1000,4000)
plt.ylim(1000,4000)
plt.scatter(data['Measured'], data['Residual'])
plt.xlabel('Measured (ft)')
plt.ylabel('Residual (Meas - Model) (ft)')
plt.title('ELM3_1-4 Development: Measured WLs v Resduals')
plt.xlim(1000,4000)
plt.ylim(-1000,1000)
plt.subplot(2,2,4)
plt.show()
The code runs but it generates no plots. All i get in the command window is:
Line #175688 (got 6 columns instead of 9).
There are multiple lines involved in the message, not just 175688. I edited this question to with the for loops entered in for the new example dataset.
Thanks

datafor the points between1644and151798, don't use aforloop, just plotdata[1644:151798]instead ofdata, e.g.:plt.scatter(data[1644:151798]['Measured'], data[1644:151798]['Modelled'])np.genfromtxt, not your plotting. It seems that line 175685 in your file has 6 values instead of 9. You'll have to look at your input file.175684(just above the problem) look like?