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
  replace sets of values in an array without using loops paul18fr 7 1,628 Jun-20-2022, 08:15 PM
Last Post: paul18fr
  Keep inner Values of 2D array timste 0 1,541 Jul-26-2021, 09:04 AM
Last Post: timste
  [machine learning] identifying a number 0-9 from a 28x28 picture, not working SheeppOSU 0 1,823 Apr-09-2021, 12:38 AM
Last Post: SheeppOSU
  Calculating consecutive days in a 3D array chai0404 0 1,885 Aug-27-2020, 10:28 PM
Last Post: chai0404
  Adding data in 3D array from 2D numpy array asmasattar 0 2,168 Jul-23-2020, 10:55 AM
Last Post: asmasattar
  Comparing and Identifying ID with Percentage jonatasflausino 1 2,407 Jun-23-2020, 06:44 PM
Last Post: hussainmujtaba
  Read json array data by pandas vipinct 0 1,901 Apr-13-2020, 02:24 PM
Last Post: vipinct
  Creating look up table/matrix from 3d data array chai0404 3 2,824 Apr-09-2020, 04:53 AM
Last Post: buran
  Replacing values for specific columns in Panda data structure Padowan 1 14,634 Nov-27-2017, 08:21 PM
Last Post: Padowan
  Match two data sets based on item values klllmmm 7 6,351 Mar-29-2017, 02:33 PM
Last Post: zivoni

Forum Jump:

User Panel Messages

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