i want to give if condition in my pandas column, but nothing applied. I had check dtypes of column and it said Float32, am i wrong in any typing or somewhat i dont know
i had tried this code :
How to use numpy.where with logical operators
Numpy "where" with multiple conditions
multiple if else conditions in pandas dataframe and derive multiple columns
and i try to use numpy.where, but nothing happen.. data['growth'] always have result 2
my code :
data['growth'] = np.where(np.logical_and(data['tqty'] < 0, data['qty_x'] < 0), 1, 2)
i dont prefer to use if or numpy.where
many thanks