danfo.streamJSON
Streams a JSON file from a local or remote location in chunks. Each intermediate chunk is passed as a DataFrame to the callback function.
Parameters
Type
Description
Stream JSON file from local path
const dfd = require("danfojs-node")
const path = require("path")
const filePath = path.join(process.cwd(), "raw_data", "book_small.json");
dfd.streamJSON(filePath, (df) => {
if (df) {
// Do any processing here
df.print();
}
});//Showing the last rows
...
╔════════════╤═══════════════════╤═══════════════════╤═══════════════════╤═══════════════════╗
║ │ book_id │ title │ image_url │ authors ║
╟────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────╢
║ 10 │ 32848471 │ Egomaniac │ https://images.… │ Vi Keeland ║
╚════════════╧═══════════════════╧═══════════════════╧═══════════════════╧═══════════════════╝
╔════════════╤═══════════════════╤═══════════════════╤═══════════════════╤═══════════════════╗
║ │ book_id │ title │ image_url │ authors ║
╟────────────┼───────────────────┼───────────────────┼───────────────────┼───────────────────╢
║ 11 │ 33288638 │ Wait for It │ https://s.gr-as… │ Mariana Zapata ║
╚════════════╧═══════════════════╧═══════════════════╧═══════════════════╧═══════════════════╝Stream JSON file from remote path
Last updated