0

I have one array (name df) and dataframe (name data).

Array consists of unique id, say df=array([10,11,12]).

And dataframe consists of 3 columns: data, id, value.

I want to filter dataframe in such a way that it should only contain id specified in array

not_speshal
  • 22,093
  • 2
  • 15
  • 30
Bikash Jha
  • 31
  • 1
  • 4

1 Answers1

4

IIUC:

data = data[data["id"].isin(df)]
not_speshal
  • 22,093
  • 2
  • 15
  • 30