Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
help creating an array
#1
I have a question. I have a dataframe in format ['x','y','z']. The columns have 100 values in them.
I also have created a regular grid in the following manner.
extent = x_min, x_max, y_min, y_max = [df.x.min()-100, df.x.max()+100, df.y.min()-100, df.y.max()+100]
grid_x, grid_y = np.mgrid[x_min:x_max:100, y_min:y_max:100]
Now question: I would like to create a an array of 100x100 where it is filled with NaNs if the point is not on the grid. And it should equal to z value if the point 'x' 'y' is found in my dataframe. Any suggestions? Thank you!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Creating a numpy array from specific values of a spreadsheet column JulianZ 0 1,112 Apr-19-2022, 07:36 AM
Last Post: JulianZ
  Issue with creating an array of pixel data for PNG files in Google Colab The_Sarco 1 1,921 Apr-29-2020, 12:03 AM
Last Post: bowlofred

Forum Jump:

User Panel Messages

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