Skip to content
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.

NiklasRosenstein/ts-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@nrosenstein/ts-utils

Various things implemented in TypeScript.

Development

  • npm run test to run unit tests
  • npm run publish to publish to NPM

Contents


@nrosenstein/ts-utils/dataframe

A DataFrame class inspired by Pandas, with minimal features.

Quickstart

import { DataFrame } from "@nrosenstein/ts-utils/dataframe";

let df = new DataFrame([[1, 2, 3], [1, 5, 6], [2, 8, 9]], ["col1", "col2", "col3"]);
expect(df.column("col2").sum()).toBe(15);

let agg = df.groupBy("col1").agg(df => ({
  sum: df.column("col2").sum()
}))
expect(agg.column("sum").toArray()).toStrictEqual([7, 8]);