Every time that I compare two dataframes that have missing values the error is generated ValueError: Can only compare identically-labeled Series

This script compares two dataframes and creates a dataframe with the columns that have mismatches values the problem that I'm facing is that when I have no value in one of the rows I get an error: `ValueError: Can only compare identically-labeled Series. For example look at df1 which have one missing value at column 1980 so if I compare this to df2 the error will be generated.

df1
    Country 1980    1981    1982    1983    1984
    Bermuda         0.00687 0.00727 0.00971 0.00752
    Canada  9.6947  9.58952 9.20637 9.18989 9.78546
 Greenland       7  0.00746 0.00722 0.00505 0.00799
    Mexico  3.72819 4.11969 4.33477 4.06414 4.18464



 df2
    Country 1980    1981    1982    1983    1984
    Bermuda 0.77777 0.00687 0.00727 0.00971 0.00752
    Canada  9.6947  9.58952 9.20637 9.18989 9.78546
  Greenland 0.00791 0.00746 0.00722 0.00505 0.00799
    Mexico  3.72819 4.11969 4.33477 4.06414 4.18464


def process_df(df):
    res = df.set_index('Country').stack()
    res.index.rename('Column', level=1, inplace=True)
    return res

df1 = process_df(df1)
df2 = process_df(df2)
mask = (df1 != df2) & ~(df1.isnull() & df2.isnull())
df3 = pd.concat([df1[mask], df2[mask]], axis=1).rename({0:'From', 1:'To'}, axis=1)
print(df3)

I want to show the missing values just like blank space, example below:

                            From         To
Country       Column                       
Bermuda       1980          0.77777   
Greenland     1980          0.00791       7