'How to assert an empty array in MAF Cucumber
I have a respone like this and this is a respone that I expected my Database query
Because that was an error cases so that when I request an API with an invalid data input, then I expected there is no data insert to Database, so how can I assert this use MAF cucumber
Does anyone know, thank you so much
Solution 1:[1]
Since you want df2 values to overwrite df1 values if the name is the same, you can drop_duplicates by name and keep the row corresponding to the last duplicate (which would come from df2):
final_df = pd.concat([df1,df2]).drop_duplicates(subset="Name:",keep="last")
Result:
Name: ID ID2 score
0 Michael 1 01 100
1 Robert 12 012 80
0 Jul 1234 01234 87
1 William 123 0123 80
2 Steven 12345 012345 99
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |

