“como substituir zero por nulo em python” Respostas de código

como substituir zero por nulo em python

data['amount']=data['amount'].replace(0, np.nan)
data['duration']=data['duration'].replace(0, np.nan)
Wide-eyed Whale

como substituir zero por nulo em python

df2[["Weight","Height","BootSize","SuitSize"]].astype(str).replace('0',np.nan)
Wide-eyed Whale

como substituir zero por nulo em python

df2.loc[df2['Weight'] == 0,'Weight'] = np.nan
df2.loc[df2['Height'] == 0,'Height'] = np.nan
df2.loc[df2['BootSize'] == '0','BootSize'] = np.nan
df2.loc[df2['SuitSize'] == '0','SuitSize'] = np.nan
Wide-eyed Whale

Respostas semelhantes a “como substituir zero por nulo em python”

Perguntas semelhantes a “como substituir zero por nulo em python”

Mais respostas relacionadas para “como substituir zero por nulo em python” em Python

Procure respostas de código populares por idioma

Procurar outros idiomas de código