I am looking to get records of location (first 2) out of a dataframe where column ID values are constant and then next 2 location records when column value is changed.
ID Location
51699457 LOC000009723262
51699457 LOC000009844932
51699457 LOC000011336522
51699457 LOC000018023392
51699458 LOC000008089735
51699458 LOC000016725720
51699458 LOC000028801236
51699459 LOC000034119383
51699459 LOC000034901728
51699459 LOC000035640991
51699459 LOC000035658463
O/P
ID Location
51699457 LOC000009723262
51699457 LOC000009844932
51699458 LOC000008089735
51699458 LOC000016725720
51699459 LOC000035640991
51699459 LOC000035658463
any help would be appreciated please.