[BUG] DataFrame is not a constructor
Bug.
I am doing this
`import DataFrame from 'dataframe-js'`
const df = new DataFrame({c1: 1, c2: 6, c3: 9, c4: 10, c5: 12}, ['c1', 'c2', 'c3', 'c4', 'c5', 'c6'])
but this keeps throwing error that DataFrame is not a constructor
Hi, Indeed, the default export seems not working well.
It seems working when not importing the default.
Workaround in esm:
import { DataFrame } from "dataframe-js";
const df = new DataFrame([[1, 2, 3]], ["a", "b", "c"]);
or in cjs:
const DataFrame = require("dataframe-js").default;
const df = new DataFrame([[1, 2, 3]], ["a", "b", "c"]);
@Gmousse Thanks, I was able to make it work using the workaround.
@Gmousse I came here to report a similar issue, but I was going to suggest updating the documentation, as this took me 20+ minutes to troubleshoot.
Alternatively/even better, you could fix the default export to work the way the documentation says it will. I don't have the time at the moment to research how to do that, but it might be a breaking change for others that already use the library. I'm not sure if that's an option.