{"id":17495750,"url":"https://github.com/iraikov/chicken-dataframe","last_synced_at":"2026-02-13T23:03:08.108Z","repository":{"id":148366453,"uuid":"184002081","full_name":"iraikov/chicken-dataframe","owner":"iraikov","description":"Tabular data structure for data analysis in Scheme","archived":false,"fork":false,"pushed_at":"2019-06-24T13:34:29.000Z","size":32,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-12T23:53:36.000Z","etag":null,"topics":["chicken-scheme","chicken-scheme-eggs","data-analysis","dataframe","linear-regression","scheme","scheme-programming-language"],"latest_commit_sha":null,"homepage":null,"language":"Scheme","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iraikov.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-29T04:56:09.000Z","updated_at":"2020-07-18T06:28:29.000Z","dependencies_parsed_at":"2023-05-13T16:45:26.483Z","dependency_job_id":null,"html_url":"https://github.com/iraikov/chicken-dataframe","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/iraikov/chicken-dataframe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iraikov%2Fchicken-dataframe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iraikov%2Fchicken-dataframe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iraikov%2Fchicken-dataframe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iraikov%2Fchicken-dataframe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iraikov","download_url":"https://codeload.github.com/iraikov/chicken-dataframe/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iraikov%2Fchicken-dataframe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29422268,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T22:20:51.549Z","status":"ssl_error","status_checked_at":"2026-02-13T22:20:49.838Z","response_time":78,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["chicken-scheme","chicken-scheme-eggs","data-analysis","dataframe","linear-regression","scheme","scheme-programming-language"],"created_at":"2024-10-19T14:27:15.743Z","updated_at":"2026-02-13T23:03:08.089Z","avatar_url":"https://github.com/iraikov.png","language":"Scheme","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dataframe\n\nTabular data structure implementation for data analysis.\n\n## Documentation\n\nThe `dataframe` library provides an interface for representing\nnumerical data in tables with rows and columns.  It is inspired by the\nvarious dataframe implementations found in R, Python and Racket.\n\nThe `dataframe` library also provides functions for loading and saving\ndata from data frames as well as routines for descriptive statistics\nand linear regression.\n\n### Columns\n\nEach dataframe consists of a collection of columns, which in turn is\nan object consisting of a unique key, data collection, and an\nassociative list of properties. The following operations are defined\non columns.\n\n\u003cprocedure\u003e(column? obj)\u003c/procedure\u003e\nReturns true if the given object is a column.\n\n\u003cprocedure\u003e(get-column-properties column)\u003c/procedure\u003e\nReturns an associative list with column properties.\n\n\u003cprocedure\u003e(get-column-key column)\u003c/procedure\u003e\nReturns the key of the column.\n\n\u003cprocedure\u003e(get-column-collection column)\u003c/procedure\u003e\nReturns the data collection of the column.\n\n\u003cprocedure\u003e(column-deserialize column port)\u003c/procedure\u003e\nLoads the data collection of a column from the given port.\n\n\u003cprocedure\u003e(column-serialize column port)\u003c/procedure\u003e\nStores the data collection of a column to the given port in an s-expression format.\n\n### Creating data frames\n\n\u003cprocedure\u003e(make-data-frame [column-key-compare:\ncompare-symbol])\u003c/procedure\u003e Creates a new dataframe, with optional\nargument a procedure that specifies how to compare column\nkeys. Default is comparison on symbols. Returns the new dataframe.\n\n\u003cprocedure\u003e(df-insert-column df key collection properties)\u003c/procedure\u003e\nInserts a new column with the given key, data collection, and\nproperties. Returns a new dataframe with the inserted column.\n\n\u003cprocedure\u003e(df-insert-derived df parent-key key proc\nproperties)\u003c/procedure\u003e Inserts a derived column, that is a column\nwhose data elements are obtained by mapping a procedure onto the\nelements of an existing (parent) column. Returns a new dataframe with\nthe inserted column.\n\n\u003cprocedure\u003e(df-insert-columns df lseq)\u003c/procedure\u003e\nInserts the columns contained in the given lseq of column objects.\n\n### Accessing data frames\n\n\u003cprocedure\u003e(show df)\u003c/procedure\u003e\nDisplays a subset of the rows and columns contained in the dataframe.\n\n\u003cprocedure\u003e(row-count df)\u003c/procedure\u003e\nReturns the number of rows in the dataframe.\n\n\u003cprocedure\u003e(df-column df key)\u003c/procedure\u003e\nReturns the column indicated by the given key.\n\n\u003cprocedure\u003e(df-columns df)\u003c/procedure\u003e\nReturns a lazy sequence containing the columns of the dataframe.\n\n\u003cprocedure\u003e(df-filter-columns df proc)\u003c/procedure\u003e\nReturns a filtered lseq of the columns of the dataframe according to the given filter predicate procedure.\n\n\u003cprocedure\u003e(df-select-columns df keys)\u003c/procedure\u003e\nReturns an lseq of the columns of the dataframe that have the keys enumerated in the given list of keys.\n\n\u003cprocedure\u003e(df-keys df)\u003c/procedure\u003e\nReturns the keys of all columns in the dataframe.\n\n\u003cprocedure\u003e(df-items df)\u003c/procedure\u003e\nReturns an lseq of the key-column pairs contained in the dataframe.\n\n\u003cprocedure\u003e(apply-collections proc df key ...)\u003c/procedure\u003e\nApplies the given procedure to the data collections of the named columns of\nthe dataframe and returns the result as a list.\n\n\u003cprocedure\u003e(apply-columns proc df key ...)\u003c/procedure\u003e\nApplies the given procedure to the named columns of the dataframe and returns the result as a list.\n\n\u003cprocedure\u003e(map-collections proc df key ...)\u003c/procedure\u003e\nApplies the given procedure to the data collections of the named columns of the dataframe and returns the result as a dataframe.\n\n\u003cprocedure\u003e(map-columns proc df key ...)\u003c/procedure\u003e\nApplies the given procedure to the named columns of the dataframe and returns the result as a dataframe.\n\n\u003cprocedure\u003e(reduce-collections proc df seed key ...)\u003c/procedure\u003e\nFold over the data collections of the named columns.\n\n### Iterators\n\n\u003cprocedure\u003e(df-for-each-column df proc)\u003c/procedure\u003e\nApplies proc to each column.\n\n\u003cprocedure\u003e(df-for-each-collection df proc)\u003c/procedure\u003e\nApplies proc to the data collection of each column.\n\n\u003cprocedure\u003e(df-gen-rows df)\u003c/procedure\u003e\nReturns a generator procedure that returns the dataframe rows in succession.\n\n\u003cprocedure\u003e(df-gen-columns df)\u003c/procedure\u003e\nReturns a generator procedure the returns the dataframe columns in succession.\n\n### Descriptive statistics\n\n\u003cprocedure\u003e(describe df port)\u003c/procedure\u003e\nDisplays a table with the min/max/mean/sdev of each column in the dataframe.\n\n\u003cprocedure\u003e(cmin df)\u003c/procedure\u003e\nComputes the minimum value of each column.\n\n\u003cprocedure\u003e(cmax df)\u003c/procedure\u003e\nComputes the maximum value of each column.\n\n\u003cprocedure\u003e(mean df)\u003c/procedure\u003e\nComputes the mean value of each column.\n\n\u003cprocedure\u003e(median df)\u003c/procedure\u003e\nComputes the median value of each column.\n\n\u003cprocedure\u003e(mode df)\u003c/procedure\u003e\nComputes the mode value of each column.\n\n\u003cprocedure\u003e(range df)\u003c/procedure\u003e\nComputes the difference between maximum and minimum value of each column.\n\n\u003cprocedure\u003e(percentile df)\u003c/procedure\u003e\nComputes the percentile values of each column.\n\n\u003cprocedure\u003e(variance df)\u003c/procedure\u003e\nComputes the variance of each column.\n\n\u003cprocedure\u003e(standard-deviation df)\u003c/procedure\u003e\nComputes the standard deviation of each column.\n\n\u003cprocedure\u003e(coefficient-of-variation df)\u003c/procedure\u003e\nComputes the coefficient of variation of each column.\n\n### Regression and correlation\n\n\u003cprocedure\u003e(linear-regression df x y)\u003c/procedure\u003e\nLinear regression between columns x and y.\n\n\u003cprocedure\u003e(correlation-coefficient df x y)\u003c/procedure\u003e\nCorrelation coefficient between columns x and y.\n\n### I/O\n\n\u003cprocedure\u003e(df-serialize df port)\u003c/procedure\u003e\nStores the dataframe in an s-expression format to the given port.\n\n\u003cprocedure\u003e(df-deserialize df port)\u003c/procedure\u003e\nLoads the data collections of the dataframe columns from the given port.\n\n## Examples\n\n```scheme\n\n(import scheme yasos dataframe dataframe-statistics)\n\n(define df (make-data-frame))\n\n(define df1\n  (df-insert-column \n   df\n   'base\n   (list-tabulate 100 (lambda (x) (- x 10)))\n   '()))\n\n\n;;  exponential series\n(define df2\n  (df-insert-derived\n   df1 'base 'exp\n   (lambda (x) (* 2.0 (exp (* 0.1 x))))\n   '()\n   ))\n\n(show df2 #f)\n(describe df2 #f)\n\n(linear-regression df2 'base 'exp)\n\n```\n\n## License\n\n\u003e\n\u003e Copyright 2019 Ivan Raikov\n\u003e \n\u003e  This program is free software: you can redistribute it and/or modify\n\u003e  it under the terms of the GNU General Public License as published by\n\u003e  the Free Software Foundation, either version 3 of the License, or (at\n\u003e  your option) any later version.\n\u003e  \n\u003e  This program is distributed in the hope that it will be useful, but\n\u003e  WITHOUT ANY WARRANTY; without even the implied warranty of\n\u003e  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n\u003e  General Public License for more details.\n\u003e \n\u003e  A full copy of the GPL license can be found at\n\u003e  \u003chttp://www.gnu.org/licenses/\u003e.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firaikov%2Fchicken-dataframe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Firaikov%2Fchicken-dataframe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firaikov%2Fchicken-dataframe/lists"}