I have two dataframe one df1 column 'A' values are same for 5 rows and then change and again same for next five rows, df2 column 'A' values are random no consecutive same value.
i want to use np.where () to give flag if df1 condition detected flag==1 and when df2 condition is detected flag==0
here need to find a way to detect flag 1 when consecutive values detected and detect flag 0 when consecutive values not detected in dataframe.
df1=pd.DataFrame({'A':[1,1,1,1,8,8,8,8,8,15,15,15]})-------> flag==1
df2=pd.DataFrame({'A':[1,3,4,7,8,11,1,15,20,15,16,87]})-----flag==0