javascriptdata / danfojs

Danfo.js is an open source, JavaScript library providing high performance, intuitive, and easy to use data structures for manipulating and processing structured data.
https://danfo.jsdata.org/
MIT License
4.81k stars 209 forks source link

Missing Series type arg in .loc #612

Open khusmann opened 1 year ago

khusmann commented 1 year ago

Describe the bug Series.loc can accept a series of bools, but this is not reflected in the type signature.

This shows a type error in VSCode:

const dfd = require("danfojs-node")

let s = new dfd.Series([12, 34, 2.2, 2, 30, 30, 2.1, 7])
s.loc(s.gt(20)).print()

Error:

Argument of type 'Series' is not assignable to parameter of type '(string | number | boolean)[]'

Expected behavior No type errors :)