@rapidsai/cudf
TypeScript icon, indicating that this package has built-in type declarations

22.12.1 • Public • Published

  node-rapids cuDF - GPU DataFrames

Installation

npm install @rapidsai/cudf

About

The js bindings for cuDF provides an API that will be familiar to data engineers & data scientists, so they can use it to easily accelerate their workflows in a Javascript runtime environment, without going into the details of CUDA programming.

For example, the following snippet creates a series, then uses the GPU to run some calculations:

var { Series, Int32 } = require("@rapidsai/cudf");

var series1 = Series.new({ type: new Int32(), data: [1, 2, 3] });
console.log(series1.mean()); // 2
console.log(series1.max()); // 3

The following snippet creates a DataFrame, then uses the GPU to to run some calculations:

var {
  DataFrame,
  DataType,
  Float64,
  GroupBy,
  Int32,
  Series,
} = require("@rapidsai/cudf");

var a = Series.new({ type: new Int32(), data: [5, 4, 3, 2, 1, 0] });
var b = Series.new({ type: new Int32(), data: [0, 0, 1, 1, 2, 2] });
var df = new DataFrame({ a: a, b: b });
var grp = new GroupBy({ obj: df, by: ["a"] });

var groups = grp.getGroups();

console.log(...groups["keys"].get("a")); // [0,1,2,3,4,5]
console.log(...groups.values?.get("b")); // [2,2,1,1,0,0]
console.log(...groups["offsets"]); // [0,1,2,3,4,5,6]

For detailed node-cuDF API, follow our API Documentation.

Readme

Keywords

none

Package Sidebar

Install

npm i @rapidsai/cudf

Weekly Downloads

5

Version

22.12.1

License

Apache-2.0

Unpacked Size

1.77 MB

Total Files

119

Last publish

Collaborators

  • rapidsai-owner
  • raydouglass
  • jacobtomlinson