jupyter / declarativewidgets

[RETIRED] Jupyter Declarative Widget Extension
http://jupyter.org/declarativewidgets/docs.html
Other
120 stars 38 forks source link

urth-viz-table sorting error #522

Closed Etiennepi closed 7 years ago

Etiennepi commented 7 years ago

Hi, when sorting percentage data using urth-viz-table, data that's in the x 10^1 range gets placed after data that starts with x, but before x+1 10^0. For example, 30% gets placed before 4%, 21% is before 3%. I get the same behavior with different datasets, and whether the data is sorted in ascending or descending order. I'm attaching a screenshot in case my explanation wasn't clear, which wouldn't surprise me.

percentdescendingerror

peller commented 7 years ago

If the data in that column is represented as a string type, it will be sorted alphabetically. You'll want to establish that data as numbers (in JSON or in your dataframe) then format with an <urth-viz-col> child tag

Etiennepi commented 7 years ago

Ahhhh, alright, thanks a lot!