我有一个包含2列的数据框:
Col1 Col2
1 NaN Someval1
2 Y Someval2
3 N Someval3
4 NaN NaN
5 NaN Someval4
我希望您能使用以下条件填充NaN值:
If Col1 has NaN and Col2 has a Someval1 that is in list 1 then fillna with Y
If Col1 has NaN and Col2 has a Someval4 that is in list 2 then fillna with N
If Col1 has NaN and Col2 has a NaN that is in list 2 then fillna with N
任何建议?(不知道是否可能)
非常感谢!