I want to create a new column based on a division of two different columns, but make sure that I do not divide by 0, if the price is 0 set it to none.
if I try to just divide I get 'inf' where the price is 0:
df['new'] = df['memory'] / df['price']
id memory price
0 0 7568 751.64
1 1 53759 885.17
2 2 41140 1067.78
3 3 10558 0
4 4 44436 1023.13
I didn't find a way to add condition