I would like to replace an entire row in a data, subject to one column in that row satisfying the condition. i.e. where red is the dataframe
['1' 0.0 ' P']
['2' 0.0 ' S']
['3' 64 ' M']
['4' 70 ' M']
red=red.replace(to_replace=' M', value=0)
returns the result:
['1' 0.0 ' P']
['2' 0.0 ' S']
['3' 64 0]
['4' 70 0]
but I would like it to return:
['1' 0.0 ' P']
['2' 0.0 ' S']
['3' 0 0]
['4' 0 0]