I have an instance extracted from a dataframe with 3 different Attributes: Atr1, Atr2 and Atr3.
On the other hand, I have a dataframe containing 4 Attributes: Atr1, Atr2, Atr3, Atr4, but the Atributes Atr1, Atr2 and Atr3 are the same as the previous mentioned instance. I have something like this:
Instance:
[Row(Atr1=u'A', Atr2=u'B', Atr3=24)]
Dataframe:
+------+------+------+------+
| Atr1 | Atr2 | Atr3 | Atr4 |
+------+------+------+------+
| 'C' | 'B' | 21 | 'H' |
+------+------+------+------+
| 'D' | 'B' | 21 | 'J' |
+------+------+------+------+
| 'E' | 'B' | 21 | 'K' |
+------+------+------+------+
| 'A' | 'B' | 24 | 'I' |
+------+------+------+------+
So, having the instance above, I want to check whether it exists an instance in the dataframe with those values for attributes Atr1, Atr2 and Atr3 and if it exists, get the value of Atr4. In this case, 'I'.
with
row
the Row anddf
the DataFrame you mentionned.