Skip to content

Instantly share code, notes, and snippets.

@MilesDowe
Created April 20, 2023 19:53
Show Gist options
  • Save MilesDowe/d057b2e8d26d52d437b2adbc23f72f58 to your computer and use it in GitHub Desktop.
Save MilesDowe/d057b2e8d26d52d437b2adbc23f72f58 to your computer and use it in GitHub Desktop.
Simple way to update a column of a DF using values from another, similar DF.
bad = bad.set_index('KeyCol').MissingCol.dropna()
good.fillna(good.drop('MissingCol', 1).join(bad, on='KeyCol'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment