I'm trying to conditionally assign a value to a column using pandas assign.
I tried using pandas assign to make a new column and label it SV if length value specified by the column sv_length is >= 50 and InDel if length is <50.
df3=df2.assign(InDel_SV='InDel' if df2.sv_length < 50 else 'SV')
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
other examples use np.where. Why do I have to use numpy? shouldn't this simple function be part of pandas?
https://chrisalbon.com/python/data_wrangling/pandas_create_column_using_conditional/