I have two dataframes which I've loaded from two csv files. Examples:
old
+--------+---------+----------+
|HOTEL ID|GB |US |
+--------+---------+----------+
| 80341| 0.78| 0.7|
| 255836| 0.6| 0.6|
| 245281| 0.78| 0.99|
| 229166| 0.0| 0.7|
+--------+---------+----------+
new
+--------+---------+----------+
|HOTEL ID|GB |US |
+--------+---------+----------+
| 80341| 1 | 0.7|
| 255836| 0.6| 1 |
| 245281| 0.78| 0.99|
| 333 | 0.0| 0.7|
+--------+---------+----------+
and I would like to get:
expected result
+--------+---------+----------+
|HOTEL ID|GB |US |
+--------+---------+----------+
| 80341| 1 | None|
| 255836| None| 1 |
| 333 | 0.0| 0.7|
+--------+---------+----------+
I have been fiddling with the dataframe foreach method, but failing to get it to work... as a spark newbie would be grateful for any clues.
Cheers!
Rafael