{"id":32178265,"url":"https://github.com/open-cogsci/datamatrix","last_synced_at":"2026-06-03T13:00:34.780Z","repository":{"id":44875134,"uuid":"48946088","full_name":"open-cogsci/datamatrix","owner":"open-cogsci","description":"An intuitive, Pythonic way to work with tabular data","archived":false,"fork":false,"pushed_at":"2026-03-04T10:54:50.000Z","size":37941,"stargazers_count":27,"open_issues_count":0,"forks_count":10,"subscribers_count":2,"default_branch":"1.0","last_synced_at":"2026-03-04T17:44:19.085Z","etag":null,"topics":["analysis","data-analysis","data-structures","python","scientific-computing"],"latest_commit_sha":null,"homepage":"https://pydatamatrix.eu/","language":"Python","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/open-cogsci.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","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,"zenodo":null}},"created_at":"2016-01-03T13:10:59.000Z","updated_at":"2026-03-04T10:54:54.000Z","dependencies_parsed_at":"2025-08-23T21:34:12.669Z","dependency_job_id":"7882f87c-a177-4846-9a92-34643e85fe03","html_url":"https://github.com/open-cogsci/datamatrix","commit_stats":{"total_commits":523,"total_committers":3,"mean_commits":"174.33333333333334","dds":0.003824091778202643,"last_synced_commit":"b6b4c985b65a4e391420030efc685b0276cd4569"},"previous_names":["smathot/python-datamatrix"],"tags_count":104,"template":false,"template_full_name":null,"purl":"pkg:github/open-cogsci/datamatrix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-cogsci%2Fdatamatrix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-cogsci%2Fdatamatrix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-cogsci%2Fdatamatrix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-cogsci%2Fdatamatrix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/open-cogsci","download_url":"https://codeload.github.com/open-cogsci/datamatrix/tar.gz/refs/heads/1.0","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-cogsci%2Fdatamatrix/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33865655,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-03T02:00:06.370Z","response_time":59,"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":["analysis","data-analysis","data-structures","python","scientific-computing"],"created_at":"2025-10-21T20:52:40.012Z","updated_at":"2026-06-03T13:00:34.774Z","avatar_url":"https://github.com/open-cogsci.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python DataMatrix\n\n*An intuitive, Pythonic way to work with tabular data.*\n\nSebastiaan Mathôt  \u003cbr /\u003e\nCopyright 2015-2026  \u003cbr /\u003e\n\u003chttps://pydatamatrix.eu/\u003e\n\n\n[![Publish to PyPi](https://github.com/open-cogsci/python-datamatrix/actions/workflows/publish-package.yaml/badge.svg)](https://github.com/open-cogsci/python-datamatrix/actions/workflows/publish-package.yaml)\n\n[![Tests](https://github.com/open-cogsci/python-datamatrix/actions/workflows/run-unittests.yaml/badge.svg)](https://github.com/open-cogsci/python-datamatrix/actions/workflows/run-unittests.yaml)\n\n\n## Contents\n\n- [About](#about)\n- [Features](#features)\n- [Ultra-short cheat sheet](#ultra-short-cheat-sheet)\n- [Documentation](#documentation)\n- [Dependencies](#dependencies)\n- [Installation](#installation)\n- [License](#license)\n\n\n## About\n\n`DataMatrix` is an intuitive Python library for working with column-based, time-series, and multidimensional data. It's a light-weight and easy-to-use alternative to `pandas`.\n\n`DataMatrix` is also one of the core libraries of [OpenSesame](https://osdoc.cogsci.nl/), a graphical experiment builder for the social sciences, and [Rapunzel](https://rapunzel.cogsci.nl/), a modern code editor for numerical computing with Python and R.\n\n\n## Features\n\n- [An intuitive syntax](https://pydatamatrix.eu/basic) that makes your code easy to read\n- Mix tabular data with [time series](https://pydatamatrix.eu/series) and [multidimensional data](https://pydatamatrix.eu/multidimensional) in a single data structure\n- Support for [large data](https://pydatamatrix.eu/largedata) by intelligent (and automatic) offloading of data to disk when memory is running low\n- Advanced [memoization (caching)](https://pydatamatrix.eu//memoization)\n- Requires only the Python standard libraries (but you can use `numpy` to improve performance)\n- Compatible with your favorite data-science libraries:\n    - `seaborn` and `matplotlib` for [plotting](https://pythontutorials.eu/numerical/plotting)\n    - `scipy`, `statsmodels`, and `pingouin` for [statistics](https://pythontutorials.eu/numerical/statistics)\n    - `mne` for analysis of electroencephalographic (EEG) and magnetoencephalographic (MEG) data\n    - [Convert](https://pydatamatrix.eu/convert) to and from `pandas.DataFrame`\n    - Looks pretty inside a Jupyter Notebook\n\n\n## Ultra-short cheat sheet\n\n```python\nfrom datamatrix import DataMatrix, io\n# Read a DataMatrix from file\ndm = io.readtxt('data.csv')\n# Create a new DataMatrix\ndm = DataMatrix(length=5)\n# The first two rows\nprint(dm[:2])\n# Create a new column and initialize it with the Fibonacci series\ndm.fibonacci = 0, 1, 1, 2, 3\n# You can also specify column names as if they are dict keys\ndm['fibonacci'] = 0, 1, 1, 2, 3\n# Remove 0 and 3 with a simple selection\ndm = (dm.fibonacci \u003e 0) \u0026 (dm.fibonacci \u003c 3)\n# Get a list of indices that match certain criteria\nprint(dm[(dm.fibonacci \u003e 0) \u0026 (dm.fibonacci \u003c 3)])\n# Select 1, 1, and 2 by matching any of the values in a set\ndm = dm.fibonacci == {1, 2}\n# Select all odd numbers with a lambda expression\ndm = dm.fibonacci == (lambda x: x % 2)\n# Change all 1s to -1\ndm.fibonacci[dm.fibonacci == 1] = -1\n# The first two cells from the fibonacci column\nprint(dm.fibonacci[:2])\n# Column mean\nprint(dm.fibonacci[...])\n# Multiply all fibonacci cells by 2\ndm.fibonacci_times_two = dm.fibonacci * 2\n# Loop through all rows\nfor row in dm:\n    print(row.fibonacci) # get the fibonacci cell from the row\n# Loop through all columns\nfor colname, col in dm.columns:\n    for cell in col: # Loop through all cells in the column\n        print(cell) # do something with the cell\n# Or just see which columns exist\nprint(dm.column_names)\n```\n\n\n## Documentation\n\nThe basic documentation (including function and module references) is hosted on \u003chttps://pydatamatrix.eu/\u003e. Additional tutorials can be found in the data-science course on \u003chttps://pythontutorials.eu/\u003e.\n\n\n## Dependencies\n\n`DataMatrix` requires only the Python standard library. That is, you can use it without installing any additional Python packages (although the pip and conda packages install some of the optional dependencies by default). Python 3.7 and higher are supported.\n\nThe following packages are required for extra functionality:\n\n- `numpy` and `scipy` for using the `FloatColumn`, `IntColumn`, `SeriesColumn`, `MultiDimensionalColumn` objects\n- `pandas` for conversion to and from `pandas.DataFrame`\n- `mne` for conversion to and from `mne.Epochs` and `mne.TFR`\n- `fastnumbers` for improved performance\n- `prettytable` for creating a text representation of a DataMatrix (e.g. to print it out)\n- `openpyxl` for reading and writing `.xlsx` files\n- `json_tricks` for hashing, serialization to and from `json`, and memoization (caching)\n- `tomlkit` for reading configuration from `pyproject.toml`\n- `psutil` for dynamic loading of large data\n\n\n## Installation\n\n\n### PyPi\n\n~~~\npip install datamatrix\n~~~\n\n\n*Historical note:* The DataMatrix project used to correspond to another package of the same name, which was discontinued in 2010. If you want to install this package, you can do still do so by providing an explicit version (0.9 is the latest version of this package), as shown below. With thanks to [dennogumi.org](https://www.dennogumi.org/) for handing over this project's entry on PyPi, thus avoiding much unnecessary confusion!\n\n~~~\n# Doesn't install datamatrix but a previous package by the same name!\npip install datamatrix==0.9\n~~~\n\n\n### Anaconda\n\n~~~\nconda install datamatrix -c conda-forge\n~~~\n\n\n### Ubuntu\n\nUbuntu packages are no longer provided. Instead, you can use the PyPi package as described above.\n\n\n## License\n\n`python-datamatrix` is licensed under the [GNU General Public License\nv3](http://www.gnu.org/licenses/gpl-3.0.en.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-cogsci%2Fdatamatrix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopen-cogsci%2Fdatamatrix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-cogsci%2Fdatamatrix/lists"}