© 2026 LinearBytes Inc.
Search posts, tags, users, and pages
Mark
If I understand the question correctly, then I think this StackOverflow question has the answer:
Pandas Use Value if Not Null, Else Use Value From Next Column
df["col_a"] = df["col_a"].fillna(df["col_b"])
Faisal Malik
Data engineer
Thank you so much!