我有以下数据框(DF)
我希望将行折叠为以下格式
我不想遍历列,而是想使用pandas来实现这一点。
col1 | col2 | col3 | col4 | col5 | col6
0 - | 15.0 | - | - | - | -
1 - | - | - | - | - | US
2 - | - | - | Large | - | -
3 ABC1 | - | - | - | - | -
4 - | - | 24RA | - | - | -
5 - | - | - | - | 345 | -
我希望将行折叠为以下格式
output DF:
col1 | col2 | col3 | col4 | col5 | col6
0 ABC1 | 15.0 | 24RA | Large | 345 | US
我不想遍历列,而是想使用pandas来实现这一点。
NaN
还有哪些其他值? - Psidom