Stack Exchange
Stack Overflow
Questions
Tags
Users
About
Stack Overflow
Public
Questions
Tags
Users
About
How to modify column row in pandas based on another column row
Asked
Nov 05 '21 at 21:21
Active
Nov 05 '21 at 21:24
Viewed
18 times
0
Pseudo code:
For each value in column A: if value == NaN then replace value with corresponding column B value
Given:
Result:
python
pandas
numpy
asked Nov 05 '21 at 21:21
PinAppleRedbull
81
1
6
1
`df = df.bfill(axis=1)`?
–
not_speshal
Nov 05 '21 at 21:22
kindly share data, not pics. you can try `df.bfill(1)` and see if that works
–
sammywemmy
Nov 05 '21 at 21:22
0 Answers
0