Closed Pl-Mrcy closed 4 years ago
I was not able to reproduce your error on Dnotebook.
What version of the library are you using?
I was able to reproduce it using Dnotebook.
const arrayShort = [
{
label: "ABC",
value: 1
},
{
label: "DEF",
value: 2
},
{
label: "GHI",
value: 3
}
];
const dfShort = new dfd.DataFrame(arrayShort);
const arrayLong = [
{
label: "ABC",
value2: 4
},
{
label: "DEF",
value2: 5
},
{
label: "JKL",
value2: 6
},
{
label: "MNO",
value2: 7
}
];
const dfLong = new dfd.DataFrame(arrayLong);
// 1
let howStr = "left"
let tmp = dfd.merge({
left: dfLong,
right:dfShort,
on: ["label"],
how: howStr
})
table(tmp.head());
// 2
howStr = "right"
tmp = dfd.merge({
left: dfShort,
right:dfLong,
on: ["label"],
how: howStr
})
table(tmp.head());
These two attempts give an error (TypeError: i is undefined
) and a wrong output respectively.
I use danfojs-node@0.1.5
May I know when would this fix be released in node npm?
Joining with
dfd.merge
two dataframes fails whenever the left dataframe has more rows than the right dataframe (no matter if you do a left, right, inner or outer join).Similarly, the output of a right join (with a longer dataframe as the right dataframe) is wrong. It outputs only the number of rows of the left dataframe.
A basic example that ends up falling on my machine:
The second attempt to join fails.