I have two dataframes:
- df_a
- df_b
df_a have data from SQL Server table with more than 120 columns. In this table each row is indicators (kpi's) from some project in a such date df_b came from excel and is a subset of kpi's in df_a
index to join dataframes: 'wind_farm' and 'reference' (reference is in yyyy-mm-dd format)
in df_b, has data to update in last months, and new data to add this month for each project
O just want to update df_a with new and updated data from df_b.
I tried using pd.merge(df_a, df_b, on=[ 'wind_farm', 'reference'], how='outer')
but pandas just created new columns with prefixes.
Then i tried removing all "_x" and replacing with all "_y" columns, but this changes my table columns data types and removed all data that not in excel file.
I have two dataframes:
- df_a
- df_b
df_a have data from SQL Server table with more than 120 columns. In this table each row is indicators (kpi's) from some project in a such date df_b came from excel and is a subset of kpi's in df_a
index to join dataframes: 'wind_farm' and 'reference' (reference is in yyyy-mm-dd format)
in df_b, has data to update in last months, and new data to add this month for each project
O just want to update df_a with new and updated data from df_b.
I tried using pd.merge(df_a, df_b, on=[ 'wind_farm', 'reference'], how='outer')
but pandas just created new columns with prefixes.
Then i tried removing all "_x" and replacing with all "_y" columns, but this changes my table columns data types and removed all data that not in excel file.