Skip to content

Instantly share code, notes, and snippets.

@leo-bianchi
Created May 21, 2019 20:33
Show Gist options
  • Select an option

  • Save leo-bianchi/48224a8bbd925031379349d9a1e2feb5 to your computer and use it in GitHub Desktop.

Select an option

Save leo-bianchi/48224a8bbd925031379349d9a1e2feb5 to your computer and use it in GitHub Desktop.
Pandas fill NaN values on csv file#python #pandas
# Preenche as linhas NaN com 0 para fazer a converão de tipos
final[['fone1', 'ddd']] = final[['fone1', 'ddd']].fillna(
'0').astype(float).astype(int).astype(str)
# Substitui as linhas com 0 por None(nulo)
final['fone1'] = final['fone1'].replace({'0': None})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment