I'm using dataframes from pandas and I have 2 tables: The first one:
+----------------------------+
| ID | Code | Name | Desc |
------------------------------
| 00002 | AAAA | Aaaa | A111 |
------------------------------
| 12345 | BBBB | Bbbb | B222 |
------------------------------
| 01024 | EEEE | Eeee | E333 |
------------------------------
| 00010 | CCCC | Cccc | C444 |
------------------------------
| 00123 | ZZZZ | Zzzz | Z555 |
------------------------------
| ..... | .... | .... | .... |
+----------------------------+
The second table:
+--------------------------------+
| EID | Cat | emaN | No | cseD |
----------------------------------
| 00010 | 1 | | | |
----------------------------------
| 12345 | 1 | | | |
----------------------------------
| | 1 | | | |
+--------------------------------+
I want to update the second table with the values from the first one, so that it turns out:
+--------------------------------+
| EID | Cat | emaN | No | cseD |
----------------------------------
| 00010 | 1 | Сссс | | С444 |
----------------------------------
| 12345 | 1 | Bbbb | | B222 |
----------------------------------
| | 1 | | | |
+--------------------------------+
But the difficulty is that the column names are different, the key ID -> EID and the values Name -> emaN, Desc -> cseD, and the column Cat (the values are filled initially) and No (empty values) must remain in the output table unchanged. Also in the 2nd table there can be empty EIDs, so this entry should remain as it was.
How is it possible to make such an update or merge?
Thanks.