0

I got this Pandas Dataframe data. Inside, in the start column i have date in datetime format. In the duration column i have a timedelta format. What i whanted to do is to get new datetime in the second line, [by doing 0:00+0:20=0:20.

But when i tried to data["start"][1] = data["start"][0] + data["duration"][0] i recieve SettingWithCopyWarning Error.

Or data["start"][2] = data["start"][1] + data["duration"][1]. But it still works. I wonder have can i fix this?

Addm1X
  • 27
  • 7

1 Answers1

0

You can use .loc as follows:

data.loc[1, "start"] = data.loc[0, "start"] + data.loc[0, "duration"]
SeaBean
  • 22,547
  • 3
  • 13
  • 25