鱼C论坛

 找回密码
 立即注册
查看: 2269|回复: 1

describe问题

[复制链接]
发表于 2021-1-25 16:38:27 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
本帖最后由 1476372787 于 2021-1-25 19:10 编辑

看下面那个回复
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2021-1-25 18:46:07 | 显示全部楼层
还有一个问题就是在数据框中,describe打印的是有数值的列,但是当所有的列都含有非数值时,打印的是不是就是含有非数值最少的那列呢?
如下例子:
  1. Step 14. Summarize the DataFrame.
  2. In [51]:
  3. users.describe() #Notice: by default, only the numeric columns are returned.
  4. Out[51]:
  5. age
  6. count        943.000000
  7. mean        34.051962
  8. std        12.192740
  9. min        7.000000
  10. 25%        25.000000
  11. 50%        31.000000
  12. 75%        43.000000
  13. max        73.000000
  14. Step 15. Summarize all the columns
  15. In [52]:
  16. users.describe(include = "all") #Notice: By default, only the numeric columns are returned.
  17. Out[52]:
  18. age        gender        occupation        zip_code
  19. count        943.000000        943        943        943
  20. unique        NaN        2        21        795
  21. top        NaN        M        student        55414
  22. freq        NaN        670        196        9
  23. mean        34.051962        NaN        NaN        NaN
  24. std        12.192740        NaN        NaN        NaN
  25. min        7.000000        NaN        NaN        NaN
  26. 25%        25.000000        NaN        NaN        NaN
  27. 50%        31.000000        NaN        NaN        NaN
  28. 75%        43.000000        NaN        NaN        NaN
  29. max        73.000000        NaN        NaN        NaN
复制代码
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-6-28 23:44

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表