{"id":34174907,"url":"https://github.com/shulhan/tabula","last_synced_at":"2025-12-15T12:03:25.211Z","repository":{"id":57551655,"uuid":"52467089","full_name":"shuLhan/tabula","owner":"shuLhan","description":"A Go library for working with rows, columns, or matrix (deprecated, see https://github.com/shuLhan/share/tree/master/lib/tabula).","archived":true,"fork":false,"pushed_at":"2018-11-28T23:33:14.000Z","size":78,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-11-22T14:53:31.157Z","etag":null,"topics":["datamining","dataset","go","golang","matrix","slice"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shuLhan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-24T19:04:27.000Z","updated_at":"2023-01-28T19:35:23.000Z","dependencies_parsed_at":"2022-09-13T04:02:24.626Z","dependency_job_id":null,"html_url":"https://github.com/shuLhan/tabula","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/shuLhan/tabula","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuLhan%2Ftabula","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuLhan%2Ftabula/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuLhan%2Ftabula/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuLhan%2Ftabula/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shuLhan","download_url":"https://codeload.github.com/shuLhan/tabula/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuLhan%2Ftabula/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27750687,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-15T02:00:09.782Z","response_time":96,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["datamining","dataset","go","golang","matrix","slice"],"created_at":"2025-12-15T12:03:20.505Z","updated_at":"2025-12-15T12:03:25.202Z","avatar_url":"https://github.com/shuLhan.png","language":"Go","readme":"[![GoDoc](https://godoc.org/github.com/shuLhan/tabula?status.svg)](https://godoc.org/github.com/shuLhan/tabula)\n[![Go Report Card](https://goreportcard.com/badge/github.com/shuLhan/tabula)](https://goreportcard.com/report/github.com/shuLhan/tabula)\n![cover.run go](https://cover.run/go/github.com/shuLhan/tabula.svg)\n\nPackage tabula is a Go library for working with rows, columns, or matrix\n(table), or in another terms working with data set.\n\nNOTE: This package has been deprecated. See\nhttps://github.com/shuLhan/share/tree/master/lib/tabula for latest implementation.\n\n# Overview\n\nGo's slice gave a flexible way to manage sequence of data in one type, but what\nif you want to manage a sequence of value but with different type of data?\nOr manage a bunch of values like a table?\n\nYou can use this library to manage sequence of value with different type\nand manage data in two dimensional tuple.\n\n## Terminology\n\nHere are some terminologies that we used in developing this library, which may\nhelp reader understand the internal and API.\n\nRecord is a single cell in row or column, or the smallest building block of\ndataset.\n\nRow is a horizontal representation of records in dataset.\n\nColumn is a vertical representation of records in dataset.\nEach column has a unique name and has the same type data.\n\nDataset is a collection of rows and columns.\n\nGiven those definitions we can draw the representation of rows, columns, or\nmatrix:\n\n            COL-0  COL-1 ...  COL-x\n    ROW-0: record record ... record\n    ROW-1: record record ... record\n    ...\n    ROW-y: record record ... record\n\n## What make this package different from other dataset packages?\n\n### Record Type\n\nThere are only three valid type in record: int64, float64, and string.\n\nEach record is a pointer to interface value. Which means,\n\n- Switching between rows to columns mode, or vice versa, is only a matter of\n  pointer switching, no memory relocations.\n- When using matrix mode, additional memory is used only to allocate slice, the\n  record in each rows and columns is shared.\n\n### Dataset Mode\n\nTabula has three mode for dataset: rows, columns, or matrix.\n\nFor example, given a table of data,\n\n    col1,col2,col3\n    a,b,c\n    1,2,3\n\n- When in \"rows\" mode, each line is saved in its own slice, resulting in Rows:\n\n  ```\n  Rows[0]: [a b c]\n  Rows[1]: [1 2 3]\n  ```\n\n  Columns is used only to save record metadata: column name, type, flag and\n  value space.\n\n- When in \"columns\" mode, each line saved in columns, resulting in Columns:\n\n  ```\n  Columns[0]: {col1 0 0 [] [a 1]}\n  Columns[1]: {col2 0 0 [] [b 2]}\n  Columns[1]: {col3 0 0 [] [c 3]}\n  ```\n\n  Each column will contain metadata including column name, type, flag, and\n  value space (all possible value that _may_ contain in column value).\n\n  Rows in \"columns\" mode is empty.\n\n- When in \"matrix\" mode, each record is saved both in row and column using\n  shared pointer to record.\n\n  Matrix mode consume more memory by allocating two slice in rows and columns,\n  but give flexible way to manage records.\n\n## Features\n\n- **Switching between rows and columns mode**.\n\n- [**Random pick rows with or without replacement**](https://godoc.org/github.com/shuLhan/tabula#RandomPickRows).\n\n- [**Random pick columns with or without replacement**](https://godoc.org/github.com/shuLhan/tabula#RandomPickColumns).\n\n- [**Select column from dataset by index**](https://godoc.org/github.com/shuLhan/tabula#SelectColumnsByIdx).\n\n- [**Sort columns by index**](https://godoc.org/github.com/shuLhan/tabula#SortColumnsByIndex),\n  or indirect sort.\n\n- [**Split rows value by numeric**](https://godoc.org/github.com/shuLhan/tabula#SplitRowsByNumeric).\n  For example, given two numeric rows,\n\n  ```\n  A: {1,2,3,4}\n  B: {5,6,7,8}\n  ```\n\n  if we split row by value 7, the data will splitted into left set\n\n  ```\n  A': {1,2}\n  B': {5,6}\n  ```\n\n  and the right set would be\n\n  ```\n  A'': {3,4}\n  B'': {7,8}\n  ```\n\n- [**Split rows by string**](https://godoc.org/github.com/shuLhan/tabula#SplitRowsByCategorical).\n  For example, given two rows,\n\n  ```\n  X: [A,B,A,B,C,D,C,D]\n  Y: [1,2,3,4,5,6,7,8]\n  ```\n\n  if we split the rows with value set `[A,C]`, the data will splitted into left\n  set which contain all rows that have A or C,\n\n  ```\n  \t\tX': [A,A,C,C]\n  \t\tY': [1,3,5,7]\n  ```\n\n  and the right set, excluded set, will contain all rows which is not A or C,\n\n  ```\n  \t\tX'': [B,B,D,D]\n  \t\tY'': [2,4,6,8]\n  ```\n\n- [**Select row where**](https://godoc.org/github.com/shuLhan/tabula#SelectRowsWhere).\n  Select row at column index x where their value is equal to y (an analogy to\n  _select where_ in SQL).\n  For example, given a rows of dataset,\n  ```\n  ROW-1: {1,A}\n  ROW-2: {2,B}\n  ROW-3: {3,A}\n  ROW-4: {4,C}\n  ```\n  we can select row where the second column contain 'A', which result in,\n  ```\n  ROW-1: {1,A}\n  ROW-3: {3,A}\n  ```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshulhan%2Ftabula","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshulhan%2Ftabula","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshulhan%2Ftabula/lists"}