[Numpy-discussion] NA masks for NumPy are ready to test
Sat Aug 20 11:32:40 CDT 2011
On Fri, Aug 19, 2011 at 4:52 PM, Bruce Southey <firstname.lastname@example.org> wrote:
> On Fri, Aug 19, 2011 at 3:05 PM, Mark Wiebe <email@example.com> wrote:
> > On Fri, Aug 19, 2011 at 11:44 AM, Charles R Harris
> > <firstname.lastname@example.org> wrote:
> >> My main peeve is that NA is upper case ;) I suppose that could use some
> >> discussion.
> > There is some proliferation of cases in the NaN case:
> >>>> np.nan
> > nan
> >>>> np.NAN
> > nan
> >>>> np.NaN
> > nan
> > The pros I see for NA over na are:
> > * less confusion of NA vs nan (should this carry over to the np.isna
> > function, should it be np.isNA according to this point?)
> > * more comfortable for switching between NumPy and R when people have to
> > both at the same time
> > The main con is:
> > * Inconsistent with current nan, inf printing. Here's a hackish
> >>>> np.na = np.NA
> >>>> np.set_printoptions(nastr='na')
> >>>> np.array([np.na, 2.0])
> > array([na, 2.])
> > What's your list of pros and cons?
> > -Mark
> >> Chuck
> In part I sort of like to have NA and nan since poor
> eyesight/typing/editing avoiding problems dropping the last 'n'.
> Regarding nan/NAN, do you mean something like my ticket 1051?
> I do not care that much about the case (mixed case is not good)
> provided that there is only one to specify these.
> Also should np.isfinite() return False for np.NA?
> >>> np.isfinite([1,2,np.NA,4])
> array([ True, True, NA, True], dtype=bool)
This is correct according to the NA computational model in the NEP. An NA
represents a value which exists but is unknown, and could be anything
representable by the type. Thus, it could the a finite number or it could be
inf, meaning the answer to isfinite could be True or it could be False, and
the answer must be NA.
> Anyhow, many thanks for the replies to my observations and your
> amazing effect in getting this done.
Thanks for taking the time to take the software for a spin, I appreciate
> NumPy-Discussion mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion