'Panda merge returns NAN values

Please consider 2 dataframes panda df1 and df2:

df1 = pd.read_csv('df1.csv',  sep=';')

df2 = pd.read_csv('df2.csv',  sep=';')

We convert to date fields:

df1['DAT_DATETIME'] = pd.to_datetime(df1['DAT_DATETIME'], format='%Y-%m-%d %H:%M:%S')
df2['DAT_MESURE'] = pd.to_datetime(df2['DAT_MESURE'], format='%Y-%m-%d %H:%M:%S')

enter image description here

enter image description here

As you can see for example Df1 row 4092 matchs with Df2 row 1072 on columns: df1.DAT_DATETIME + df1.NUM_DEVICE_ID_SENCROP and df2.DAT_MESURE + df2.NUM_DEVICE_ID

But with panda merge I get only NAN values. Why please? Thanks. enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source