[Numpy-discussion] BOF notes: Fernando's proposal: NumPy ndarray with named axes

Joshua Holbrook josh.holbrook@gmail....
Tue Jul 6 11:52:31 CDT 2010


On Tue, Jul 6, 2010 at 8:42 AM, Skipper Seabold <jsseabold@gmail.com> wrote:
> On Tue, Jul 6, 2010 at 12:36 PM, Joshua Holbrook
> <josh.holbrook@gmail.com> wrote:
>> I'm kinda-sorta still getting around to building/reading the sphinx
>> docs for datarray. <_< Like, I've gone through them before, but it was
>> more cursory than I'd like. Honestly, I kinda let myself get caught up
>> in trying to automate the process of getting them onto github pages.
>>
>> I have to admit that I didn't 100% understand the reasoning behind not
>> allowing integer ticks (I blame jet lag--it's a nice scapegoat). I
>> believe it originally had to do with what you meant if you typed, say,
>> A[3:"london"]; Did you mean the underlying ndarray index 3, or the
>> outer level "tick" 3? I think if you didn't allow integers, then you
>> could simply wrap your "3" in a string: A["3":"London"] so it's
>> probably not a deal-breaker, but I would imagine that using (a)
>> separate method(s) for label-based indexing may make allowing
>> integer-datatyped labels.
>>
>> Thoughts?
>
> Would you mind bottom-posting/ posting in-line to make the thread
> easier to follow?
>
>>
>> --Josh
>>
>> On Tue, Jul 6, 2010 at 8:23 AM, Keith Goodman <kwgoodman@gmail.com> wrote:
>>> On Tue, Jul 6, 2010 at 9:13 AM, Skipper Seabold <jsseabold@gmail.com> wrote:
>>>> On Tue, Jul 6, 2010 at 11:55 AM, Keith Goodman <kwgoodman@gmail.com> wrote:
>>>>> On Tue, Jul 6, 2010 at 7:47 AM, Joshua Holbrook <josh.holbrook@gmail.com> wrote:
>>>>>> I really really really want to work on this. I already forked datarray
>>>>>> on github and did some research on What Other People Have Done (
>>>>>> http://jesusabdullah.github.com/2010/07/02/datarray.html ). With any
>>>>>> luck I'll contribute something actually useful. :)
>>>>>
>>>>> I like the figure!
>>>>>
>>>>> To do label indexing on a larry you need to use lix, so lar.lix[...]
>>>>
>>>> FYI, if you didn't see it, there are also usage docs in dataarray/doc
>>>> that you can build with sphinx that show a lot of the thinking and
>>>> examples (they spent time looking at pandas and larry).
>>>>
>>>> One question that was asked of Wes, that I'd propose to you as well
>>>> Keith, is that if DataArray became part of NumPy, do you think you
>>>> could use it to work on top of for larry?
>>>
>>> This is all very exciting. I did not know that DataArray had ticks so
>>> I never took a close look at it.
>>>
>>> After reading the sphinx doc, one question I had was how firm is the
>>> decision to not allow integer ticks? I use int ticks a lot.
>
> I think what Josh said is right.  However, we proposed having all of
> the new labeled axis access pushed to a .aix (or whatever) method, so
> as to avoid any confusion, as the original object can be accessed just
> as an ndarray.  I'm not sure where this leaves us vis-a-vis ints as
> ticks.
>
> Skipper
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>

Sorry re: posting at-top. I guess habit surpassed observation of
community norms for a second there. Whups!

My opinion on the matter is that, as a matter of "purity," labels
should all have the string datatype. That said, I'd imagine that
passing an int as an argument would be fine, due to python's
loosey-goosey attitude towards datatypes. :) That, or, y'know,
str(myint).

--Josh


More information about the NumPy-Discussion mailing list