当前位置:网站首页>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()
边栏推荐
- High imitation Netease cloud music
- Leetcode skimming ---202
- Leetcode - 706 design hash mapping (Design)*
- Leetcode skimming ---217
- Tensorflow—Image segmentation
- SQL Server Management Studio cannot be opened
- Leetcode skimming ---10
- Common scenarios in which Seata distributed transactions fail and do not take effect (transactions do not rollback)
- MySQL报错“Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre”解决方法
- What useful materials have I learned from when installing QT
猜你喜欢

High imitation Netease cloud music

Entropy method to calculate weight

Yolov5 creates and trains its own data set to realize mask wearing detection

Data preprocessing - Data Mining 1

Free online markdown to write a good resume

Introduction to deep learning linear algebra (pytorch)

Ind kwf first week

安装yolov3(Anaconda)

Softmax 回归(PyTorch)

High imitation bosom friend manke comic app
随机推荐
OpenCV Error: Assertion failed (size.width>0 && size.height>0) in imshow
Hands on deep learning pytorch version exercise answer - 2.2 preliminary knowledge / data preprocessing
【吐槽&脑洞】关于逛B站时偶然体验的弹幕互动游戏魏蜀吴三国争霸游戏的一些思考
Matrix calculation of Neural Network Introduction (pytoch)
Preliminary knowledge of Neural Network Introduction (pytorch)
六、MySQL之数据定义语言(一)
Leetcode刷题---189
Automatic derivation of introduction to deep learning (pytoch)
Model evaluation and selection
An open source OA office automation system
Content type ‘application/x-www-form-urlencoded;charset=UTF-8‘ not supported
Hands on deep learning pytorch version exercise solution -- implementation of 3-2 linear regression from scratch
神经网络入门之模型选择(PyTorch)
A complete mall system
Hands on deep learning pytorch version exercise solution - 2.4 calculus
[graduation season] the picture is rich, and frugality is easy; Never forget chaos and danger in peace.
Leetcode skimming ---10
Secure in mysql8.0 under Windows_ file_ Priv is null solution
Neural Network Fundamentals (1)
Linear regression of introduction to deep learning (pytorch)