Use xray.DataArray for histograms with lower / upper bin edges?

51 views
Skip to first unread message

Christoph Deil

unread,
Nov 23, 2015, 5:44:28 AM11/23/15
to xray
Is there a way to use `xray.DataArray` for histograms?

I mean something like [1] where bins can have variable width and it's possible to store and use the lower and upper edge of each bin.

As far as I can see this is not supported, a `DataArray` has just one label per item.
So I think `xray.DataArray` doesn't work for this application?

Before we go off and implement our own axis and histogram classes, I wanted to ask if you see some way to directly use or re-use part of xray?
Or is there some other Numpy-based Python package you're aware of that provides such a class?

For our applications we don't need indexing functionality on the axes, but handling dimensions by name is something we do want.

Thanks in advance for any tips!

Christoph


Stephan Hoyer

unread,
Nov 23, 2015, 1:32:30 PM11/23/15
to xray
Hi Christoph,

It sounds like what you're looking for is a natural way to represent labeling with intervals. This is actually something I've been working on for pandas under the name "IntervalIndex", which I'm hoping to finish up for the next major release:

Of course, once this is merged into pandas, we'll add support for it in xray, too.

I'm going to get together a demo notebook to show off the functionality of IntervalIndex this week. I'll CC you when I have that ready to share. I don't know if it encompasses all the functionality you're looking for, but hopefully it comes close and we can work together to fill out the missing components.

Stephan

--
You received this message because you are subscribed to the Google Groups "xray" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xray-dev+u...@googlegroups.com.
To post to this group, send email to xray...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xray-dev/19cf0ca3-5617-4e1f-a7ed-05950dfecd51%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages