Hacker News new | ask | show | jobs
by sheepshear 1008 days ago
Why not use a structured array with an 'isna' field to use as a mask when performing operations?
1 comments

How is that convenient? Missing data support belongs deep in NumPy itself (or any other similar package) so that operations can do the right thing and missing values propagate correctly. For example, let's say you want by definition missing values to sort last. If you roll out your custom missing value marker, you'll also need to roll out your own custom sort function. And the same for a whole lot more stuff.
What about a MaskedArray? ndarrays are homogeneous by definition.