Fill Empty Values from another Column

Date: 25 March 2018

Category: Python

Tags: Pandas, Neat Tricks

Credit: Stack Overflow

If you want to create a column which uses a value from one column when it is not blank, and a value from another when it is, the following trick can be used:

df['Col3'] = df['Col1'] # Where Col1 is known to contain some blanks

df['Col3'].fillna(df['Col2'])