rapidsai / node

GPU-accelerated data science and visualization in node

Home Page:https://rapidsai.github.io/node/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Series binops for basic arithmetic

thomcom opened this issue · comments

At present, binops for Series objects are not implemented. It would be nice to have basic arithmetic binops:

const {Series} = require('@rapidsai/cudf');
const intScalar = 1;
const floatScalar = 1.1;
const x = Series.new([1, 2, 3]);
const y = Series.new([4, 5, 6]);
const aString1 = x + intScalar; // '  0\n0.0\n1.0\n2.0\n1'
const Nan1 = x - intScalar; // NaN
const Nan2 = x / intScalar; // NaN
const Nan3 = x * intScalar; // NaN
const aString2 = x + floatScalar; // '  0\n0.0\n1.0\n2.0\n1.1'
const Nan4 = x - floatScalar; // NaN
const Nan5 = x / floatScalar; // NaN
const Nan6 = x * floatScalar; // NaN
const aStringString = x + y; // '  0\n0.0\n1.0\n2.0\n  0\n3.0\n4.0\n5.0\n'

I haven't researched how difficult this will be in the context of node-rapids, but it an important nice-to-have for me.

Unfortunately, we'd need somthing like https://github.com/tc39/proposal-operator-overloading to be accepted before we could implement operator overloads.