Closed
Description
Describe the bug
Sorting by a "YYYY-MM-DD" date string does not sort the data in the expected sort order and is not consistent with sorting of those strings using Array.prototype.sort()
.
To Reproduce
In a Node.js REPL:
const dfd = require('danfojs-node');
const data = {
date: [ '1974-02-19', '1955-12-06', '1963-11-18' ]
};
const df = new dfd.DataFrame(data);
df.sort_values({by: 'date'}).print();
Expected behavior
This table will be output:
date | |
---|---|
0 | 1955-12-06 |
1 | 1963-11-18 |
2 | 1974-02-19 |
Observed behavior
This table is output
date | |
---|---|
0 | 1974-02-19 |
1 | 1955-12-06 |
2 | 1963-11-18 |
Screenshots
N/A This is running in a Node.js REPL on MacOS 10.15.7.
Additional context
- Node Version: 16.13.0
- Danfo version: 0.3.2