Skip to content
Advertisement

Pandas – Reverse sign of column value based on another value

Can anyone suggest how to do this currectly.

Currently I am using apply but it obviously goes through each cell and takes ages.

list-price – Float ordtype = str (“I”,”C”,”K”)

I want all the “C” & “K” values in the column ordtype to be negative (they are currently positive)

example code i’m using now:

JavaScript

Advertisement

Answer

Try with:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement