Python Forum
Identifying consecutive masked values in a 3D data array
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Identifying consecutive masked values in a 3D data array
#11
Assuming that you have function 'consecutives' which works as expected on 1D arrays just use it along the axis of 2D array:

np.apply_along_axis(consecutives, 2, array)
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply
#12
Many thanks for your help!

I have a follow-up question -
How can I identify the number of consecutive events, say for a particular month or season, for a 3d data array with longitude, latitude and time?
Reply
#13
You should provide (sample) data and your own effort solving it before seeking for help.
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Calculating consecutive days in a 3D array chai0404 0 381 Aug-27-2020, 10:28 PM
Last Post: chai0404
  Adding data in 3D array from 2D numpy array asmasattar 0 375 Jul-23-2020, 10:55 AM
Last Post: asmasattar
  Comparing and Identifying ID with Percentage jonatasflausino 1 505 Jun-23-2020, 06:44 PM
Last Post: hussainmujtaba
  Read json array data by pandas vipinct 0 360 Apr-13-2020, 02:24 PM
Last Post: vipinct
  Creating look up table/matrix from 3d data array chai0404 3 502 Apr-09-2020, 04:53 AM
Last Post: buran
  Replacing values for specific columns in Panda data structure Padowan 1 12,694 Nov-27-2017, 08:21 PM
Last Post: Padowan
  Match two data sets based on item values klllmmm 7 3,105 Mar-29-2017, 02:33 PM
Last Post: zivoni
  how to select particular rows data from a array raady07 3 2,065 Mar-06-2017, 02:21 AM
Last Post: raady07
  Identifying items in a csv file that also appear in a Text extract Jaynorth 17 7,728 Sep-21-2016, 10:51 PM
Last Post: Jaynorth

Forum Jump:

User Panel Messages

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