Skip to content
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

fix some bugs #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix some bugs #16

wants to merge 1 commit into from

Conversation

mrcangye
Copy link

#15
修复第二章项目集合-第二章:第一节数据清洗及特征处理.ipynb部分答案错误
1.df[df['Age']==None]

df[df['Age']==None]=0
df.head(3)

以上代码无法筛选出NaN值
2.df[df['Age'].isnull()]

df[df['Age'].isnull()] = 0 # 还好
df.head(3)

以上代码可以筛选出NaN值,但是df[df['Age'].isnull()] = 0会将NaN值所在行全部置0,使得结果有误,且后面的重复值相关代码使用的也是这一行代码生成的数据
3.df[df['Age'] == np.nan]

df[df['Age'] == np.nan] = 0
df.head()

以上代码中,np.nan不可以与任何数进行比较。使用np.isnan()进行修复

@mrcangye
Copy link
Author

@ChuanyuXue

@ChuanyuXue
Copy link
Member

@ChuanyuXue

Hi,

Thank you for your contribution. @andongBlue

@mrcangye
Copy link
Author

mrcangye commented Nov 15, 2022

@ChuanyuXue
这个 PR 的结果请问何时能够完成?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants