Forums

Putting many coordinates number inside codes

Hi everyone, I have a coordinate list. This starts from (0,0) to (10,10). Each x and y coordinate increases by 1, this is like

(0,0) (0,1) (0,2) (0,3) ... (0,10) (1,0) (1,1) (1,2) (1,3) ... (1,10) . . . (10,0) (10,1) (10,2) (10,3) ... (10,10).

I need to put all these coordinates inside my codes respectively without entering the numbers manually.

My code is supposed to be like that:

"inpNETCDF ='abc.nc' dataset = Dataset(inpNETCDF, mode='r') lat_site, lon_site = 0, 0"

"inpNETCDF ='abc.nc'" dataset = Dataset(inpNETCDF, mode='r') lat_site, lon_site = 0, 1" ...

Could you help me do that? Thank you.

This is not really the forum for general Python programming teaching, but you're probably looking to use a for loop of some sort using the range function. Do a bit of googling around on those 2 topics and you should be able to work it out.