I have a text file with 3240 rows and 1 column of values. Every 81 values represents one layer in a 2-D framework. So after 81 values, I would reach z=2, then 162, z=3 and so forth until then end (should be 40 x levels). I want to append the values in this text file to create a 2-D array, that basically represents a value at a specific (x,z) point. Here's what I have:
df = pd.read_excel("/nfs/home11/grad/2017/et654149/ATM562/HW3/HW3atm562.xlsx")
pivals=df.as_matrix()
pi=[]
l=np.arange(0, 3320, 41)
count=0
i=0
for i in range(len(l)):
pi[0][i].append(pivals[i])
count=count+1
I keep getting the error "list index out of range" and honestly I have no idea if what I'm trying to accomplish is even correct with the code I am using. Eventually I want to plot this value on a contour filled plot.
Edit: I've tried using reshape before and after the comment below, but I am getting the error "index 40 is out of bounds for axis 1 with size 1".