I'm searching for solution how to replace several strings within one cell inside of data frame in Python-Pandas.
Each column has unique elements to be replaced based on legend that is already defined.
I've already find solution how to replace values within column, but result that I get replace only one string at time, and removing other. For example cell value: AA, BB, CC legend: AA - Level 1, BB - Level 2, CC - Level 3, DD - Level 4 result: Level 1.
Data set:
Field Name | Category 1 | Category 2
Test1 AA BB CC LD DD
Test2 BB CC DD
Test3 AA LD
Test4 AA BB DD LD DD
Legend:
AA - Level 1, BB - Level 2, CC - Level 3, DD - Level 4
LD - High, DD - Low
I expect result to be combined with one cell, for example: Level 1; Level 2 while cell value was AA, BB