pivot

package
v0.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

README

pivot

Overview

reshape a matrix or map by re-indexing like the pivot function in pandas

Description

Reshape data (produce a “pivot” table) based on column values. Uses unique values from specified index / columns to form axes of the resulting DataFrame. It currently supports data aggregations such as Sum, Count, Mean, Min and Max.

Implementation details

Input Data - [array or map] Column(s) to use for populating new frame’s values.

Params Index - []string : Name of columns which value to be used to make new frame’s index. Columns - []string : Name of columns which value to be used to make new frame’s columns. Aggregate - map[string]string : Map key is groupKey, map value is aggregate function. Currently support Sum, Count, Mean, Min, Max

OutputType - [DataFrame]

Compliance to Spec

Rough level of compliance

100%

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type Input

type Input struct {
	Data interface{} `md:"data"`
}

func (*Input) FromMap

func (i *Input) FromMap(values map[string]interface{}) error

type Operation

type Operation struct {
	// contains filtered or unexported fields
}

func (*Operation) Eval

func (operation *Operation) Eval(inputs map[string]interface{}) (interface{}, error)

type Params

type Params struct {
	Index     []string            `md:"index"`
	Columns   []string            `md:"columns"`
	Aggregate map[string][]string `md:"aggregate"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL