So far, when I needed to add rows to a dataframe, I used loc (or more rarely, iloc). In a dataframe like this one:
key1 key2 value
2014-02-03 12:00:00 22 32 98.89
2014-02-03 12:00:00 23 33 99.25
2014-02-03 12:00:00 24 34 99.78
2014-02-03 15:00:00 22 32 96.54
2014-02-03 15:00:00 23 33 97.21
2014-02-03 15:00:00 24 34 98.59
I used:
df.loc[pd.to_datetime('2014-02-03 18:00:00')] = [23, 32, 98.84]
But if I need to add rows with the same index (imagine another row with 2014-02-03 15:00:00) then loc gives me error. I have been trying methods like concat or merge but I don't get anything. Thanks.