0
df:
      AAAA   BBBB  CCCC
1111  17878    2    2
2222  17878    2    3
3333  11777    2    4
4444  11888    5    5

I have a series below:

ser:

17878
11777

I want my df to look like thi:

df:
      AAAA   BBBB  CCCC
1111  17878    2    2
2222  17878    2    3
3333  11777    2    4

This is the code that i found but it does not work with series

df.groupby(['AAAA']).get_group(ser)
user324313
  • 51
  • 6

1 Answers1

0

Something like this might work -

df = df[df['AAAA'].isin(ser.tolist())]
Sajan
  • 1,247
  • 1
  • 5
  • 13