我有一个如下所示的 Pandas DataFrame - 我正在使用 Python Pandas。
+------------+---------+---------+----------+--------+
| Movie Name | English | Chinese | Japanese | Korean |
+------------+---------+---------+----------+--------+
| A | 1 | 0 | 0 | 0 |
| B | 0 | 1 | 1 | 0 |
| C | 0 | 1 | 1 | 1 |
| D | 1 | 0 | 0 | 0 |
| E | 0 | 1 | 0 | 0 |
+------------+---------+---------+----------+--------+
我想通过基于值(0或1)串联标头名称来将其转换为以下内容。
预期输出
+------------+-------------------------+
| Movie Name | Languages |
+------------+-------------------------+
| A | English |
| B | Chinese, Japanese |
| C | Chinese,Japanese,Korean |
| D | English |
| E | Chinese |
+------------+-------------------------+