Aggregation in TimeSeries chart

Hi,

I’m new to Bokeh. Is it possible to do aggregation on TimeSeries charts? Say I have a data set with (timestamp, expense amount) tuples. How can I plot mean expenses over time? I could resample the data set beforehand to be (date rang, mean expense amount) and plot that. Can this be done by Bokeh for me?

Thanks

Jonas

Easier to aggregate with pandas and plot the result

···

On Tuesday, May 31, 2016 at 1:47:39 PM UTC-4, Jonas Haag wrote:

Hi,

I’m new to Bokeh. Is it possible to do aggregation on TimeSeries charts? Say I have a data set with (timestamp, expense amount) tuples. How can I plot mean expenses over time? I could resample the data set beforehand to be (date rang, mean expense amount) and plot that. Can this be done by Bokeh for me?

Thanks

Jonas

You should prepare and aggregate your data before passing things to charts.TimeSeries.

···

On Tue, May 31, 2016 at 12:47 PM, [email protected] wrote:

Hi,

I’m new to Bokeh. Is it possible to do aggregation on TimeSeries charts? Say I have a data set with (timestamp, expense amount) tuples. How can I plot mean expenses over time? I could resample the data set beforehand to be (date rang, mean expense amount) and plot that. Can this be done by Bokeh for me?

Thanks

Jonas

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/c211f767-2066-4f8a-99cd-4884f485c947%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Fabio Pliger

Senior Software Engineer, Bokeh

Thanks for the reply. Just so we’re on the same page: In short, this means “no, what you want isn’t possible with Bokeh”?

Jonas

···

On 01 Jun 2016, at 17:09, Fabio Pliger <[email protected]> wrote:

You should prepare and aggregate your data before passing things to charts.TimeSeries.

We are telling you to separate the tasks of data munging and plotting

···

On Wed, Jun 1, 2016 at 11:18 AM, Jonas Haag [email protected] wrote:

On 01 Jun 2016, at 17:09, Fabio Pliger [email protected] wrote:

You should prepare and aggregate your data before passing things to charts.TimeSeries.

Thanks for the reply. Just so we’re on the same page: In short, this means “no, what you want isn’t possible with Bokeh”?

Jonas

You received this message because you are subscribed to a topic in the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/bokeh/aUb0s7HRsEc/unsubscribe.

To unsubscribe from this group and all its topics, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/95BC4B0F-E8C2-4134-9C14-87349E42E632%40cashlink.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Understood, I’m just wondering if this doesn’t actually belong to the plotting component? What if you want to zoom the data further than the aggregation date range? If I understand things correctly I have to decide beforehand what X axis ranges are likely to be viewed? (If my aggregation interval is too small, the plot will be difficult to read; if it is too large, some details will be missing if zoomed in far enough.)

Jonas

···

On 01 Jun 2016, at 17:23, Aaron Goldenberg <[email protected]> wrote:

We are telling you to separate the tasks of data munging and plotting

Hi Jonas,

Bokeh is actually two libraries, the python "bokeh" module and a JavaScript library, BokehJS. When you make a plot with Bokeh (python), you are actually constructing a declarative JSON representation of your visualization, and shipping it to BokehJS to be interpreted and displayed. But this means normally you have to ship all the data ahead of time. We can't do things like scale-dependent re-sampling and aggregation automatically the browser using pandas, because your browser can't run python code. To accomplish that kind of functionality, there are basically two options

* Do it in JavaScript

* Use a Bokeh Server to respond to range updates with real python code

The downside to "doing it in JS" is that BokehJS is already a large library by JS standards. We can't continually bloat core BokehJS by adding every possible imaginable feature, or it will become unusable. On the other hand, it is now possible to extend Bokeh and BokehJS with custom user models, so something like this might make a prime candidate for that. In fact I believe some folks have already made custom models to support scale-dependent downsampling.

Certainly a Bokeh app is also a reasonable approach, but that's something a user would write because the user knows what kind of downsampling or refined is appropriate to the actual data and use case.

If your data is very large, and you want things like automatic progressive refinement and visual queries across large scales, you might want to look into the related (OSS) DataShader project, that integrates closely with Bokeh:

  https://github.com/bokeh/datashader

  http://datashader.readthedocs.io/en/latest/

  http://go.continuum.io/datashader/

Last link is a webinar behind a small questionnaire.

Thanks,

Bryan

···

On Jun 1, 2016, at 10:30 AM, Jonas Haag <[email protected]> wrote:

On 01 Jun 2016, at 17:23, Aaron Goldenberg <[email protected]> wrote:

We are telling you to separate the tasks of data munging and plotting

Understood, I’m just wondering if this doesn’t actually belong to the plotting component? What if you want to zoom the data further than the aggregation date range? If I understand things correctly I have to decide beforehand what X axis ranges are likely to be viewed? (If my aggregation interval is too small, the plot will be difficult to read; if it is too large, some details will be missing if zoomed in far enough.)

Jonas

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/4FA2E4F3-832D-427D-ACF7-828D897A1B54%40cashlink.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hi Bryan,

thanks for the detailed answer. I’ve had a look at Datashader and I gotta say it looks very promising! Thanks for the pointer!

···

On 01 Jun 2016, at 17:51, Bryan Van de Ven <[email protected]> wrote:

The downside to "doing it in JS" is that BokehJS is already a large library by JS standards. We can't continually bloat core BokehJS by adding every possible imaginable feature, or it will become unusable.

Fair enough. To be clear, the problem I’m having with lots of samples isn’t performance; it’s that I can’t make sense of the data because it’s just too many data points and time series charts don’t support client-side aggregation/binning. For binning of course a histogram suits best, but Bokeh’s charts.Histogram doesn’t seem to support date time on the X axis. (I’m also not quite sure it supports client-side binning…)

Jonas