当前位置:网站首页>Classification (data consolidation and grouping aggregation)
Classification (data consolidation and grouping aggregation)
2022-07-03 10:38:00 【weixin_ forty-three million six hundred and ninety-one thousand】
First read in the data ,
Ideas : Reconstruct an all 0 Array of , The column name is classification , If a classification appears in a piece of data , let 0 Turn into 1
List of statistical classifications df['Genre"].str.split(',').tolist()
df.join()# Merge data with the same index ,
Data consolidation .
Merge row indexes .join(index)
Column index for merging merge(coloms)
df3=pd.DatsFrame(np.zeros(3,3)),columns=list("fax"))
df1.merge(df3,on="a") according to a Column index for operation
merge Combine
df3.loc[1,"a"]=1

merge outer Combine nan completion
merge left On the left nan completion
merge right On the right ,nan completion
Data packet aggregation :df.groupby()
DataFrameGroupby It can be traversed
Index and composite index
Index methods and properties print(grouped1.index)
df.index=['x','y']
df1.reindex['a','f']# To reset index
df.set_index("a")# Specify a column as an index
df.set_index("a”,unique)
matplotlib Map the top 10% of the total number of stores in the country
Prepare the data df.hroupby=(by=Country').count().sort_values(ascending=False)[:10])
_x=data1.index()
边栏推荐
猜你喜欢

侯捷——STL源码剖析 笔记

一步教你溯源【钓鱼邮件】的IP地址

Hands on deep learning pytorch version exercise answer - 2.2 preliminary knowledge / data preprocessing

C#项目-寝室管理系统(1)

MySQL报错“Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre”解决方法

Hands on deep learning pytorch version exercise solution - 2.3 linear algebra
![Step 1: teach you to trace the IP address of [phishing email]](/img/a5/c30bc51da560c4da7fc15f434dd384.png)
Step 1: teach you to trace the IP address of [phishing email]

【吐槽&脑洞】关于逛B站时偶然体验的弹幕互动游戏魏蜀吴三国争霸游戏的一些思考

What did I read in order to understand the to do list

熵值法求权重
随机推荐
Pytorch ADDA code learning notes
The imitation of jd.com e-commerce project is coming
Step 1: teach you to trace the IP address of [phishing email]
Class-Variant Margin Normalized Softmax Loss for Deep Face Recognition
Ind wks first week
Seata分布式事务失效,不生效(事务不回滚)的常见场景
Ut2013 learning notes
Weight decay (pytorch)
Leetcode刷题---278
Hands on deep learning pytorch version exercise solution - 2.3 linear algebra
Binary search method
Leetcode刷题---374
【吐槽&脑洞】关于逛B站时偶然体验的弹幕互动游戏魏蜀吴三国争霸游戏的一些思考
An open source OA office automation system
Leetcode skimming ---217
多层感知机(PyTorch)
2-program logic
Tensorflow—Neural Style Transfer
Leetcode skimming ---374
High imitation wechat