DataTable sort not always "stable"

The sort appears not always to be a stable sort. Stable sorting is actually quite important in a table widget as it is quite common to display data where unique values are defined by the combination of multiple columns. Right now the order appears to be random sometimes. Is this a feature of the underlying table library SlickGrid? I googled around a bit and one of the SlickGrid discussions suggested that the sort was stable but it was a little unclear: [Feature Request] Extend the sort functionality · Issue #9 · mleibman/SlickGrid · GitHub

An example screenshot is below. Note the ABBA order of the first 4 rows. It should be ABAB.

To reproduce the problem run the following code in an ipython notebook and then click on column A, then column B. If you don’t see the problem try A and then B again. After 1,2 or 3 tries it almost always happens.

from bokeh import models, plotting, widgets

j = 10
df = pandas.DataFrame(dict(A=[‘A’]*j + [‘B’]*j, B=[i for i in range(j)]*2))
source = models.ColumnDataSource(df)
columns = [
widgets.TableColumn(field=c, title=c) for c in df.columns
]
data_table = widgets.DataTable(source=source, columns=columns, editable=True, width=1000)
plotting.show(data_table)

``

I’m using bokeh ‘0.7.1.dev.20150109’ and Chrome Version 39.0.2171.71

–Tom

Hi Tom,

This will require some actual investigation. Can you post all this information on a GH issue?

Thanks,

Bryan

···

On Jan 13, 2015, at 7:58 PM, Tom <[email protected]> wrote:

The sort appears not always to be a stable sort. Stable sorting is actually quite important in a table widget as it is quite common to display data where unique values are defined by the combination of multiple columns. Right now the order appears to be random sometimes. Is this a feature of the underlying table library SlickGrid? I googled around a bit and one of the SlickGrid discussions suggested that the sort was stable but it was a little unclear: [Feature Request] Extend the sort functionality · Issue #9 · mleibman/SlickGrid · GitHub

An example screenshot is below. Note the ABBA order of the first 4 rows. It should be ABAB.

To reproduce the problem run the following code in an ipython notebook and then click on column A, then column B. If you don't see the problem try A and then B again. After 1,2 or 3 tries it almost always happens.

from bokeh import models, plotting, widgets

j = 10
df = pandas.DataFrame(dict(A=['A']*j + ['B']*j, B=[i for i in range(j)]*2))
source = models.ColumnDataSource(df)
columns = [
    widgets.TableColumn(field=c, title=c) for c in df.columns
]
data_table = widgets.DataTable(source=source, columns=columns, editable=True, width=1000)
plotting.show(data_table)

I'm using bokeh '0.7.1.dev.20150109' and Chrome Version 39.0.2171.71

--Tom

--
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/711b2b26-9689-431a-88b3-5a0b1562a205%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Thanks Bryan. I posted it here:

···

On Tuesday, January 13, 2015 at 11:27:45 PM UTC-5, Bryan Van de ven wrote:

Hi Tom,

This will require some actual investigation. Can you post all this information on a GH issue?

Thanks,

Bryan

On Jan 13, 2015, at 7:58 PM, Tom [email protected] wrote:

The sort appears not always to be a stable sort. Stable sorting is actually quite important in a table widget as it is quite common to display data where unique values are defined by the combination of multiple columns. Right now the order appears to be random sometimes. Is this a feature of the underlying table library SlickGrid? I googled around a bit and one of the SlickGrid discussions suggested that the sort was stable but it was a little unclear: https://github.com/mleibman/SlickGrid/issues/9

An example screenshot is below. Note the ABBA order of the first 4 rows. It should be ABAB.

To reproduce the problem run the following code in an ipython notebook and then click on column A, then column B. If you don’t see the problem try A and then B again. After 1,2 or 3 tries it almost always happens.

from bokeh import models, plotting, widgets

j = 10

df = pandas.DataFrame(dict(A=[‘A’]*j + [‘B’]*j, B=[i for i in range(j)]*2))

source = models.ColumnDataSource(df)

columns = [

widgets.TableColumn(field=c, title=c) for c in df.columns

]

data_table = widgets.DataTable(source=source, columns=columns, editable=True, width=1000)

plotting.show(data_table)

I’m using bokeh ‘0.7.1.dev.20150109’ and Chrome Version 39.0.2171.71

–Tom


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/711b2b26-9689-431a-88b3-5a0b1562a205%40continuum.io.

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