i have array of data as given below.
a=np.array([1,2,3,4,5,6,7,8,1,2,3,4,5,6])
i want to get conditional formatting like a>5
i can get it with np.where
. But np.where is continuous checking for next true
np.where(a>5,'T','F')
> array(['F', 'F', 'F', 'F', 'F', 'T', 'T', 'T', 'F', 'F', 'F', 'F', 'F', 'T'], dtype='<U1')
i want to skip the consecutive True Value like when a>5
comes to 6 its True
but for 7 also it is True
which i dont want. I want only 1st one.
But also if value drops from 7 to 4 and again rise to 6 then that 6 should be True
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…