I have some timeseries data
time x y
1s 34 8017
1s 43 5019
1s 1 8017
2s 64 8870
2s 34 8305
2s 11 8305
3s 343 8221
3s 3 8221
3s 143 8221
that I grouped by df.groupby(data.index.second) using python pandas groupby. Producing 3 groups where group 1 looks like this which corresponds to the first second
time x y
1s 34 8017
1s 43 5019
1s 1 8017
How can I remove the first group (1th second) and the last group (3th second)?
I only want this group (group 2)
time x y
2s 64 8870
2s 34 8305
2s 11 8305
I have tried this without success and maybe the groupby function is not the way to go.