Function sortBy throws MixedTypeError if value in sorted column is null
See original GitHub issueHi team,
I’m using dataframe-js v1.3.2 and facing an error when trying to sort dataframe by column that contains null. Please see the following example:
let result = new DataFrame([
{Name: 'Peter', Age: 16},
{Name: 'Denis', Age: null}
], ['Name', 'Age']);
result.sortBy('Age')
Please let me know if you are going to fix this in the nearest release. Or please share some thoughts on a workaround. PS. in the project value really needs to stay null so please do not propose change null to zero 😃
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Sort Function (SortBy) - Trying to get empty cells to return ...
I have a table with around 7 headings for a simple account information table. Not all accounts have a value for each heading/field...
Read more >Sort by column ASC, but NULL values first? - Stack Overflow
Agreed; I found this useful when just wanting to sort by whether or not a value was present (in this case, a date)...
Read more >Using the LINQ OrderBy operator with null values - Jerrie Pelser
This blog post demonstrates a quick tip for sorting values in ascending order when some of the values can potentially be NULL.
Read more >Excel SORTBY function - custom sort with formula - Ablebits
See how to use the SORTBY function in Excel to sort data by a custom list, in random order, by text length, and...
Read more >sorting broken if result contains null values #7176 - GitHub
If your result contains null values the sorting breaks with a null pointer exception. Tested with numerical columns.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @episodeyang, Indeed it’s a good idea. I will see to add an additionnal parameter in order to place null, undefined or NaN values first or last.
I will try it today. I hope a release on the 1.4.0.
Stay tuned.
Released in 1.4.0