[Python-ideas] Suggestion: Extend integers to include iNaN
Steve Barnes
gadgetsteve at live.co.uk
Sat Sep 29 03:23:12 EDT 2018
On 29/09/2018 07:52, Nathaniel Smith wrote:
> On Fri, Sep 28, 2018 at 11:31 PM, Steve Barnes <gadgetsteve at live.co.uk> wrote:
>> One specific use case that springs to mind would be for Libraries such
>> as Pandas to return iNaN for entries that are not numbers in a column
>> that it has been told to treat as integers.
>
> Pandas doesn't use Python objects to store integers, though; it uses
> an array of unboxed machine integers.
>
> In places where you can use Python objects to represent numbers, can't
> you just use float("nan") instead of iNaN?
>
> -n
>
It is a shame about Pandas not using integers, (speed considerations I
would guess). Using float("nan") would possibly be incompatible with
operations down the chain which might be expecting an integer or
handling a float differently.
--
Steve (Gadget) Barnes
Any opinions in this message are my personal opinions and do not reflect
those of my employer.
---
This email has been checked for viruses by AVG.
https://www.avg.com
More information about the Python-ideas
mailing list