df['svc_port'] = np.where(
min(df['sPort'],df['dPort']) <= 1024,
min(df['sPort'],df['dPort']),
df['dPort']
)
In the above code, min(df['sPort'],df['dPort']) <= 1024
- the same thing is given in Compare two columns using pandas. I am not using any logical operators. just checking a condition and replacing it's values.
Why am I still getting this error?
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().