I have 2 matrix (lat
and lon
) of geograhical data in degrees. I want to convert them to x-y coords for plotting. Error shown is
list indices must be integers or slices, not tuple
. I am new to python and programming. kindly help
ew=lon*(180/np.pi)
ns=lat*(180/np.pi)
ew1=[[0]*3600]*1000
ns1=[[0]*3600]*1000
for a in range(0,len(ew1)):
for b in range(0,len(ew1[0])):
ew1[a,b]=ew[a,b]-ew[0,0] # ew[0,0]=center lon coord
ns1[a,b]=ns[a,b]-ns[0,91] ## ns[0,91]=center lat coord
The errror message shown at line ew1[a,b]=ew[a,b]-ew[0,0]
:
TypeError: list indices must be integers or slices, not tuple