2
I need the value of a column PERTMINIST
is changed from a set of words found in the column SIGLA
. For example you can have in the column NOME_ORGAO
the words UFJF, UFTM and update in the same row in the column PERTMINIST with string 'MEC' for example. Since there are several possible strings contained in the NOME_ORGAO column, I thought about playing in the string or set array variable. It follows code:
conmec = ['UFJF', 'UFTM','MAPA']
for linha in txtosn['SIGLA_ORGAO']:
if linha in conmec: txtosn.set_value(linha,'PERTMINIST', 'MEC')
NOTE: The above Code is placing the values correctly, but is Nan in all other columns of the same row where MEC was inserted;