Created
May 21, 2019 20:33
-
-
Save leo-bianchi/48224a8bbd925031379349d9a1e2feb5 to your computer and use it in GitHub Desktop.
Pandas fill NaN values on csv file#python #pandas
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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