I have following calculation:
df['v1'] = df['dS']/df['dt']
dt Column value can be 0 therefore when I check df['v1'].max() gives me inf value. To prevent this from happening, I want put following condition:
if df['dt']=0 then df['dS']/df['dt']=0 else calculate df['dS']/df['dt']
How do I accomplish this?
Thanks!