I am getting the following FutureWarning in my Python code:
FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
Right now I was using the append function, in various parts of my code, to add rows to an existing DataFrame.
Example 1:
init_hour = pd.to_datetime('00:00:00')
orig_hour = init_hour+timedelta(days=1)
while init_hour < orig_hour:
row = {'Hours': init_hour.time()}
df = df.append(row, ignore_index = True)
init_hour = init_hour + timedelta(minutes=60)
Example 2:
row2 = {'date': tmp_date, 'false_negatives': fn, 'total': total}
df2 = df2.append(row2, ignore_index = True)
How could I solve this in a simple way without modifying much of the code before the sections above?