So there are many variations of this question posted, but none of them are exactly what I am looking for.
I have a dataset that contains multiple columns that hold boolean values that indicate if a user listed a city name in their place of residence. It is possible for a user to have named multiple city names. See below.
Dateset example:
+----+----------+-------+-------------+------------------------------------+
| ID | New York | LA | New Orleans | New Var |
+----+----------+-------+-------------+------------------------------------+
| 1 | True | False | True | 'New York, NY', 'New Orleans, LA' |
| 2 | True | False | False | 'New York, NY |
| 3 | False | False | False | 'None' |
+----+----------+-------+-------------+------------------------------------+
What I am trying to do is create a new column that is the store the text names for all of the city names that the user listed. I could do it with a million nested if condition, but I'm sure there is a better way to do this in Pandas. Can anyone point me in the right direction?
