Created
February 4, 2022 08:39
-
-
Save Keycatowo/b4f0483a1566ef60fd17f012a5e39e4d to your computer and use it in GitHub Desktop.
pandas中對DataFrame進行統計之描述型方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 統計敘述(個別) | |
df.max() | |
df.mean() | |
df.count() # 回傳非nan數量 | |
# 統計敘述(統合) | |
df.describe() | |
# 唯一值 | |
df.apply(lambda x:x.unique(),axis=0) # uniques by columns |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
唯一值可以用apply的方式達到
![image](https://user-images.githubusercontent.com/47293699/152498325-58f954c8-87b8-43f5-841b-2bc721155dd8.png)