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

Data Analysis with Python——05 #85

Open
hsipeng opened this issue Aug 23, 2019 · 0 comments
Open

Data Analysis with Python——05 #85

hsipeng opened this issue Aug 23, 2019 · 0 comments

Comments

@hsipeng
Copy link
Owner

hsipeng commented Aug 23, 2019

Data Analysis with Python——05

Pandas 数据规整化: 清理、转换、合并、重塑

合并

  • pandas.merge
pd.merge(df1, df2, on='key', how='outer')

Screen Shot 2019-03-11 at 7.33.35 PM.png

  • pandas.concat
pd.concat([s1, s2, s3], axis = 1, join_zxes = [['a', 'c', 'b', 'e']], keys=['one', 'two', 'three'])

Screen Shot 2019-03-11 at 7.36.56 PM.png

数据转换

移除重复数据

  • duplicated 判断是否重复
  • drop_duplicates() 移除重复

利用函数或者映射进行数据转换
map

替换值
Replace

字符串

Screen Shot 2019-03-11 at 8.59.24 PM.png

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

No branches or pull requests

1 participant