[英]What is the difference between math.isnan ,numpy.isnan and pandas.isnull in python 3?
A NaN
of type decimal.Decimal causes: NaN
类型为decimal.Decimal导致:
What is the difference between math.isnan, numpy.isnan and pandas.isnull? math.isnan,numpy.isnan和pandas.isnull有什么区别?
The only difference between math.isnan and numpy.isnan is that math.isnan和numpy.isnan之间的唯一区别是
However , I suggest using math.isnan when you just want to check if a number is nan because 但是 ,我建议在只想检查数字是否为nan时使用math.isnan ,因为
numpy takes approximately 15MB of memory when importing it while numpy导入时需要大约15MB的内存 ,而
math takes only 0,2M of memory 数学仅占用0.2M的内存
As for pandas.isnull it returns True not only for nan but also for None python types and as numpy it can handle every structure of numbers. 至于pandas.isnull,它不仅为nan返回True ,还为None python类型返回True,并且作为numpy它可以处理数字的每种结构。 However, it is even more "heavy" than numpy. 但是,它比numpy更“沉重”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.