|
|
Subscribe / Log in / New account

Some median Python NaNsense

Some median Python NaNsense

Posted Jan 7, 2020 13:42 UTC (Tue) by cpitrat (subscriber, #116459)
In reply to: Some median Python NaNsense by gdt
Parent article: Some median Python NaNsense

If only there was a way to represent a missing value in Python. Some keyword that would inform that instead of containing a value, this variable contains none.


to post comments

Some median Python NaNsense

Posted Jan 8, 2020 0:02 UTC (Wed) by KaiRo (subscriber, #1987) [Link] (1 responses)

Good idea! Let's call that "No Number Encountered" or short "NoNE". What do you think?

Some median Python NaNsense

Posted Jan 8, 2020 16:02 UTC (Wed) by mathstuf (subscriber, #69389) [Link]

"No Actual Number Indicated" would go well with "nani" and the associated meme (https://www.urbandictionary.com/define.php?term=omae%20wa...)

Some median Python NaNsense

Posted Jan 10, 2020 2:29 UTC (Fri) by gdt (subscriber, #6284) [Link] (1 responses)

None isn't that useful for processing large datasets where memory efficiency matters, as typically generated by scientific instruments. Thus SciPy's overloading of NaN. Putting that another way:

import array
a = array.array('d', [1.0, 2.0, 3.0, None])
TypeError: must be real number, not NoneType

Note that I am not arguing for overloading NaN -- I don't have a dog in this fight -- I'm just using my background as a statistics professional to explain why choices your tone suggests are unreasonable have been made by people acting reasonably.

Some median Python NaNsense

Posted Jan 10, 2020 11:19 UTC (Fri) by cpitrat (subscriber, #116459) [Link]

Yes but here we're talking about statistics package, not numpy, which already takes mixed input lists as input IIUC.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds