程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Super graphic pandas, recommended collection

編輯:Python

source

https://pandastutor.com/index.html

Hello everyone , I'm Junxin .

Pandas It is a common tool of data mining , It is very important to master the functions in the process of use . This paper will use the process of Visualization , Explain Pandas Various operations of .

sort_values

(dogs[dogs['size'] == 'medium']
 .sort_values('type')
 .groupby('type').median()
)

Execution steps :

  • size List and filter out departments and branches

  • Then convert the type of the row

  • according to type Columns to group , Calculate the median

selecting a column

dogs['longevity']

groupby + mean

dogs.groupby('size').mean()

Execution steps :

  • Set the data according to size Grouping

  • Aggregate within a group

grouping multiple columns

dogs.groupby(['type', 'size'])

groupby + multi aggregation

(dogs
  .sort_values('size')
  .groupby('size')['height']
  .agg(['sum', 'mean', 'std'])
)

Execution steps

  • according to size Columns sort the data

  • according to size Grouping

  • For within group height Calculate

filtering for columns

df.loc[:, df.loc['two'] <= 20]

filtering for rows

dogs.loc[(dogs['size'] == 'medium') & (dogs['longevity'] > 12), 'breed']

dropping columns

dogs.drop(columns=['type'])

joining

ppl.join(dogs)

merging

ppl.merge(dogs, left_on='likes', right_on='breed', how='left')

pivot table

dogs.pivot_table(index='size', columns='kids', values='price')

melting

dogs.melt()

pivoting

dogs.pivot(index='size', columns='kids')

stacking column index

dogs.stack()

unstacking row index

dogs.unstack()

resetting index

dogs.reset_index()

setting index

dogs.set_index('breed')

 All rivers and mountains are always in love , Order one    OK? .
  • 【 Hard core dry goods 】Pandas Data type conversion in modules

  • Python Eight schemes to realize timed tasks , Dry cargo is full.

  • recommend 7 A commonly used Pandas Time series processing function

  • One time summary :64 A common term for data analysis !

  • A diagram that Xiaobai can understand SQL Basic knowledge of

  • The basic concepts of statistics that data analysts know

···  END  ···

Share 、 Collection 、 give the thumbs-up 、 I'm looking at the arrangement ?


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved