I have dataframe
id event_path
111 google.com
111 yandex.ru
111 vk.com
222 twitter.com
222 twitter.com
333 twitter.com
333 facebook.com
Desire output
id event_path
111 google.com
111 yandex.ru
111 vk.com
222 twitter.com
333 twitter.com
333 facebook.com
I try to use shift to column
df.loc[(df.event_path != df.event_path.shift()) & \
(df.id == df.id.shift())]
and it returns me
id event_path
111 google.com
111 yandex.ru
111 vk.com
222 twitter.com
333 facebook.com
How can I fix that?