简体   繁体   English

Pandas:DataFrame describe返回的计数是浮点数的情况是什么

[英]Pandas: What are the cases when count returned by DataFrame describe is a floating point

When describing my Pandas dataframe: i get the following result: 在描述我的Pandas数据帧时:我得到以下结果:

           Mains_1_Power  Mains_2_Power
count      17.000000      17.000000
mean       57.063528     200.428607
std        67.605151      69.364919
min        11.015203     135.492259
25%        31.850638     161.546607
50%        35.871114     183.986024
75%        56.419915     210.772911
max       312.787603     446.077603

I do not understand the cases where count should be a float, do we have half records? 我不明白count应该是浮点数的情况,我们有半记录吗? If the count is always an integer, is it just the representation, which is floating point? 如果计数总是一个整数,那么它只是表示,它是浮点数吗? It can be confusing to put up results where count is not an integer. 在count不是整数的情况下提出结果可能会令人困惑。 Is there a workaround? 有解决方法吗?

Count will always be an integer with type float64 (rather than type int ). Count将始终是float64类型的整数(而不是int类型)。

This is purely for presentation, because DataFrames columns must have the same type (or, at least, there are performance gains in them doing so over object type). 这纯粹是为了表示,因为DataFrames列必须具有相同的类型(或者,至少,它们在object类型上的性能提升)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM