Suppose I condition a dataframe the following way:
df[df['category_id'] == 'wall']
this results in:
xmin ymin xmax ymax category_id width height
30 45.0 58.0 45.0 520.0 wall 0.0 462.0
31 45.0 58.0 754.0 58.0 wall 709.0 0.0
32 302.0 58.0 302.0 520.0 wall 0.0 462.0
33 563.0 58.0 563.0 520.0 wall 0.0 462.0
34 626.0 58.0 626.0 257.0 wall 0.0 199.0
35 754.0 58.0 754.0 321.0 wall 0.0 263.0
36 563.0 159.0 754.0 159.0 wall 191.0 0.0
what I would like to do is update width and height by a constant if either one of them is 0.
I think I could use iterrows() here, but is there some more elegant way to go about this?