I want to create a column called 'Check' whose values depend on those of other columns.
I have the following dataframe df2:
Code | Description |
---|---|
78 | NaN |
and the following code:
df2['Comprobación'] = np.where(df2['Descripcion'].str.contains('OK'), 'SI', '')
The problem is that the result of the check column comes out YES when it should come out empty.
Code | Description | Verification |
---|---|---|
78 | NaN | YES |
I have tried and checked everything but I can't find the fault.
Any ideas?
Thank you