根据其他列值熊猫分配列值

时间:2020-02-10 09:45:50

标签: pandas

我很讨厌显示的数据框:

...
90  M8X     Etobicoke   The Kingsway , Montgomery Road , Old Mill North
91  M8Y     Etobicoke   Humber Bay , King's Mill Park , Kingsway Park ...
92  M8Z     Etobicoke   Kingsway Park South West , Mimico NW , The Que...
93  M9A     Queen's Park    Not assigned
...

我想将第三列中“未分配”的每个条目的值更改为第二列中该条目对应的核心值。例如

...
90  M8X     Etobicoke   The Kingsway , Montgomery Road , Old Mill North
91  M8Y     Etobicoke   Humber Bay , King's Mill Park , Kingsway Park ...
92  M8Z     Etobicoke   Kingsway Park South West , Mimico NW , The Que...
93  M9A     Queen's Park    Queen's Park
...

0 个答案:

没有答案