[Solved] Loop: Results to be updated via += if on the same date, otherwise write next line


You can use DataFrame.append and then group by the column you want to use as an index.

Let’s say that total_df is the table to which you want to add new rows, new_df is the table containing those new rows and date is the column to be used as index. Then you can use:

total_df.append(new_df).groupby(by='date').sum()

3

solved Loop: Results to be updated via += if on the same date, otherwise write next line