I want to merge or replace my data-1 of some rows based on my 'TIMESTEP' values in data-2.
I have tried both merge and replace options. On using replace, I am getting
"AttributeError: 'Series' object has no attribute '_replace_columnwise'"
And on using merge methods I am not getting the desired results. I have tried this code:
x = data1.loc[data1['TIMESTEP'] == 500000]
y = data2.loc[df_nd_merged['TIMESTEP'] == 500000]
data1.replace(x, y, inplace = True)
My data1:
TIMESTEP id mass y
2900 313 0.795699 -0.0149792
3000 462 0.782639 -0.0106693
3200 245 0.723805 -0.0167327
.....
.....
.....
TIMESTEP id mass y
2487960 9999300 9934 0.802645 -0.0827138
2488086 9999800 3849 0.833692 -0.0247934
2488130 10000000 9532 0.767143 -0.0855542
My data2:
TIMESTEP id mass y
500000 0 0 0
1000000 0 0 0
1500000 6272.0 0.877105 -0.0493408
1500000 7922.0 0.740305 -0.0443259
1500000 5699.0 0.772714 -0.0562289
2000000 0 0 0
2500000 0 0 0
3000000 0 0 0
3500000 0 0 0
4000000 0 0 0
4500000 0 0 0
5000000 0 0 0
5500000 0 0 0
6000000 1974.0 0.772978 -0.0270121
6500000 0 0 0
7000000 0 0 0
7500000 4870.0 0.92602 -0.0160799
8000000 6152.0 0.665494 -0.00542989
8500000 3300.0 0.67739 -0.0329551
9000000 30.0 0.798618 -0.0178684
9500000 0 0 0
Please help.