I want to find the rows that have a same values, after 5 repetitions in sequence. For example, I have this data:
ID. Temperat
23 30.147
24 29.523
25 32
26 32
27 32
28 32
29 32
30 32
31 32
32 32
33 32
34 32
35 32
36 32
37 32
38 29.638
And I want to get the index and the values. But in generic way
This is my code in the moment:
nunique = df.apply(pd.Series.nunique)
cols_to_drop = nunique[nunique == 1].index
df.drop(cols_to_drop, axis=1)
And I want the output like this:
ID. Temperat
25 32
26 32
27 32
28 32
29 32
30 32
31 32
32 32
33 32
34 32
35 32
36 32
37 32