0

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

RSNboim
  • 134
  • 1
  • 8
Theo75
  • 425
  • 4
  • 9
  • Does this answer your question? [Pandas Merge returns NaN](https://stackoverflow.com/questions/46754398/pandas-merge-returns-nan) – Laurent Feb 05 '22 at 09:14

0 Answers0