Error: rows parameter must be an Array - when using query function
Have attempted to us the query function on a dataframe i crated from Excel file with no success. Keep getting the same error. Finally tried the simple approach of creating a dataframe but got the same error.
tried with this code:
const dfd = require("danfojs-node");
// Sample data let data = { "Name": ["Alice", "Bob", "Charlie", "Alice", "Eve", "Frank"], "Age": [25, 30, 35, 29, 40, 45], "Occupation": ["Engineer", "Doctor", "Teacher", "Engineer", "Lawyer", "Artist"] };
// Create DataFrame let df = new dfd.DataFrame(data);
// Display the original DataFrame console.log("Original DataFrame:"); df.print();
// Query rows where 'Name' is 'Alice' let filteredDf = df.query({ "column": "Name", "is": "==", "to": "Alice" });
// Display the filtered DataFrame console.log("\nRows where Name is 'Alice':"); filteredDf.print();
I am expecting it to produce a dataframe with rows with name = "Alice"
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: mac
- Node.js v18.16.0
- Danfo.js Version 1.1.2
I am experiencing the same issue. Has any progress been made here?
Facing the same issue. Any progress ?