-
-
Notifications
You must be signed in to change notification settings - Fork 217
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When creating a dataframe from an object array, if the keys of different objects are not in the same order, the values will be mapped to an incorrect column.
To Reproduce
Sample code
const dfd = require("danfojs-node");
let data = [
{
Id: 1,
Name: 'Apple'
},
{
Name: 'Orange',
Id: 2
},
];
let df = new dfd.DataFrame(data);
df.print();
Output:
╔════════════╤═══════════════════╤═══════════════════╗
║ │ Id │ Name ║
╟────────────┼───────────────────┼───────────────────╢
║ 0 │ 1 │ Apple ║
╟────────────┼───────────────────┼───────────────────╢
║ 1 │ Orange │ 2 ║
╚════════════╧═══════════════════╧═══════════════════╝
Expected behavior
Value should be mapped to correct column depending on the object key.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working