0

Let's assume I have a dataframe df1 with the columns ['Name', 'ISIN', 'Price']. The ISINs are ['2', '4', '5', '7'].

The ISINs from df2 are ['1', '2', '3', '4'] which I have extracted into a series. Let's call the series 'isinvector'.

How can I keep only the rows of df1 if the ISIN value exists in the extracted series?

RazorLazor
  • 71
  • 5
  • Does this answer your question? [How to select rows from a DataFrame based on column values?](https://stackoverflow.com/questions/17071871/how-to-select-rows-from-a-dataframe-based-on-column-values) – AMC Feb 26 '20 at 17:30

1 Answers1

1

Found the answer here Link.

df1 = df1.loc[df1['ISIN'].isin(isinvector)] 

would do the job.

RazorLazor
  • 71
  • 5