search and replace pandas python, filter with two values

0

I have two columns:

from io import StringIO
import pandas as pd

csv =StringIO(u'''\
debit,move_id/id,
2002,32
2000,33
2001,34
2002,6166
2002,6166
2003,6541
2004,6166
2002,8089
''')

and I want to filter and change the values in debit when in debit and move_id / id they match, example:

  

df.debit [(df ["move_id / id"] == 6166) & (df.debit == 2002)]

and it would be:

     debit   move_id/id
0    2002      32
1    2000      33
2    2001      34
3    2010      6166
4    2010      6166
5    2003      6541
6    2004      6166
7    2002      8089

some idea ??

    
asked by Yan Chirino 16.05.2018 в 17:09
source

0 answers