Python Forum
Creating look up table/matrix from 3d data array
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating look up table/matrix from 3d data array
#1
Hi,
I have a data array of coastal grid cells and I need to find adjacent ocean cells from a different dataset.
To begin with, I have a 3D data array with lat, lon and time dimensions.
In this data array, whenever the variable is not equal to zero, I want to store this value in a new matrix with time as the x axis and the lat,lon coordinates as the y axis.
I have written a loop for this. A screenshot of the code and the data array is attached.
I hope you can have a look at the for loop and help me figure out how to refine it.
Once this matrix is created, I will look at the lat,lon pairs and find the adjacent cells from another dataset.
I need help with figuring out the loop for the first part.
Hope you can help.
Thank you.

Attached Files

Thumbnail(s)
   
Reply
#2
please show what you have so far.
Reply
#3
The image I have attached shows the for loop I have written but there is something wrong with it as it doesn't give me what I expect to see.
Reply
#4
Please, don't post images of code.
Please, use proper tags when post code, traceback, output, etc.
See BBcode help for more info.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Adding data in 3D array from 2D numpy array asmasattar 0 368 Jul-23-2020, 10:55 AM
Last Post: asmasattar
  Read json array data by pandas vipinct 0 354 Apr-13-2020, 02:24 PM
Last Post: vipinct
  sequential sampling from an array to a matrix nsansen 1 422 Mar-29-2020, 08:15 PM
Last Post: deanhystad
  Identifying consecutive masked values in a 3D data array chai0404 12 1,283 Feb-01-2020, 12:59 PM
Last Post: perfringo
  Creating new rows and adding them to empty data frame kapilan15 0 602 May-31-2019, 10:19 AM
Last Post: kapilan15
  "erlarge" a numpy-matrix to numpy-array PhysChem 2 870 Apr-09-2019, 04:54 PM
Last Post: PhysChem
  while creating a array using numpy.arrange, how to negate only the last 50 numbers? vicky53 1 895 Apr-06-2019, 11:52 AM
Last Post: scidam
  Match a table with sub-total values to its detail value table klllmmm 2 1,697 Apr-03-2019, 11:28 AM
Last Post: klllmmm
  How to transform array into dataframe or table? python_newbie09 2 3,927 Mar-29-2019, 07:48 PM
Last Post: python_newbie09
  creating an empty NumPy array in Python sandeepatel 2 2,518 Jan-16-2019, 09:24 AM
Last Post: rinu

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020