Here is a common scenario for me: I have 2 related dataframes, and I want to select only the values from the one dataframe based on criteria from the other dataframe. For example, below we have people (including country) and brands (related to the people) and we want to select “only brands related to people who live in Nambia”:
First I get an array of first names, based on Namibia from my people dataframe – the .values attribute is important here because it ensures that the actual names are stored in the array as shown:
Then I extract brands by first name from brands, based on the first names that were related to Namibia in people:
Voila!