-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Atividades Semana 11 #10
base: main
Are you sure you want to change the base?
Conversation
for col in Columns: | ||
if df[col].dtype == 'object': | ||
df[col] = df[col].str.replace(',', '', regex=False) | ||
df[col] = pd.to_numeric(df[col], errors='coerce') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tenho dúvidas:
- Ao tentar converter todos os tipos que são object para float você vai encontrar muitos que estão no formato correto
- Porque está usando to_numeric ao invés de astype?
- fora da condição você também decide converter para número. O que eu posso esperar? um float ou um int?
df[col] = pd.to_numeric(df[col], errors='coerce') | ||
|
||
#Substitui por zero as linhas que tem o NaN | ||
df = df.fillna(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mas vazio é diferente de valor 0, certo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GG
No description provided.