https://github.com/open-cogsci/datamatrix
An intuitive, Pythonic way to work with tabular data
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.1%) to scientific vocabulary
Keywords
Repository
An intuitive, Pythonic way to work with tabular data
Basic Info
- Host: GitHub
- Owner: open-cogsci
- License: gpl-3.0
- Language: Python
- Default Branch: 1.0
- Homepage: https://pydatamatrix.eu/
- Size: 35.2 MB
Statistics
- Stars: 26
- Watchers: 3
- Forks: 10
- Open Issues: 0
- Releases: 24
Topics
Metadata Files
readme.md
Python DataMatrix
An intuitive, Pythonic way to work with tabular data.
Sebastiaan Mathôt
Copyright 2015-2025
https://pydatamatrix.eu/
Contents
About
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.
DataMatrix is also one of the core libraries of OpenSesame, a graphical experiment builder for the social sciences, and Rapunzel, a modern code editor for numerical computing with Python and R.
Features
- An intuitive syntax that makes your code easy to read
- Mix tabular data with time series and multidimensional data in a single data structure
- Support for large data by intelligent (and automatic) offloading of data to disk when memory is running low
- Advanced memoization (caching)
- Requires only the Python standard libraries (but you can use
numpyto improve performance) - Compatible with your favorite data-science libraries:
seabornandmatplotlibfor plottingscipy,statsmodels, andpingouinfor statisticsmnefor analysis of electroencephalographic (EEG) and magnetoencephalographic (MEG) data- Convert to and from
pandas.DataFrame - Looks pretty inside a Jupyter Notebook
Ultra-short cheat sheet
```python from datamatrix import DataMatrix, io
Read a DataMatrix from file
dm = io.readtxt('data.csv')
Create a new DataMatrix
dm = DataMatrix(length=5)
The first two rows
print(dm[:2])
Create a new column and initialize it with the Fibonacci series
dm.fibonacci = 0, 1, 1, 2, 3
You can also specify column names as if they are dict keys
dm['fibonacci'] = 0, 1, 1, 2, 3
Remove 0 and 3 with a simple selection
dm = (dm.fibonacci > 0) & (dm.fibonacci < 3)
Get a list of indices that match certain criteria
print(dm[(dm.fibonacci > 0) & (dm.fibonacci < 3)])
Select 1, 1, and 2 by matching any of the values in a set
dm = dm.fibonacci == {1, 2}
Select all odd numbers with a lambda expression
dm = dm.fibonacci == (lambda x: x % 2)
Change all 1s to -1
dm.fibonacci[dm.fibonacci == 1] = -1
The first two cells from the fibonacci column
print(dm.fibonacci[:2])
Column mean
print(dm.fibonacci[...])
Multiply all fibonacci cells by 2
dm.fibonaccitimestwo = dm.fibonacci * 2
Loop through all rows
for row in dm: print(row.fibonacci) # get the fibonacci cell from the row
Loop through all columns
for colname, col in dm.columns: for cell in col: # Loop through all cells in the column print(cell) # do something with the cell
Or just see which columns exist
print(dm.column_names) ```
Documentation
The basic documentation (including function and module references) is hosted on https://pydatamatrix.eu/. Additional tutorials can be found in the data-science course on https://pythontutorials.eu/.
Dependencies
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.
The following packages are required for extra functionality:
numpyandscipyfor using theFloatColumn,IntColumn,SeriesColumn,MultiDimensionalColumnobjectspandasfor conversion to and frompandas.DataFramemnefor conversion to and frommne.Epochsandmne.TFRfastnumbersfor improved performanceprettytablefor creating a text representation of a DataMatrix (e.g. to print it out)openpyxlfor reading and writing.xlsxfilesjson_tricksfor hashing, serialization to and fromjson, and memoization (caching)tomlkitfor reading configuration frompyproject.tomlpsutilfor dynamic loading of large data
Installation
PyPi
~~~ pip install datamatrix ~~~
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 for handing over this project's entry on PyPi, thus avoiding much unnecessary confusion!
~~~
Doesn't install datamatrix but a previous package by the same name!
pip install datamatrix==0.9 ~~~
Anaconda
~~~ conda install datamatrix -c conda-forge ~~~
Ubuntu
~~~ sudo add-apt-repository ppa:smathot/cogscinl # for stable releases sudo add-apt-repository ppa:smathot/rapunzel # for development releases sudo apt-get update sudo apt install python3-datamatrix ~~~
License
python-datamatrix is licensed under the GNU General Public License
v3.
Owner
- Name: Cogsci.nl
- Login: open-cogsci
- Kind: organization
- Email: smathot@cogsci.nl
- Location: Groningen
- Website: https://www.cogsci.nl
- Twitter: cogscinl
- Repositories: 30
- Profile: https://github.com/open-cogsci
Open-source scientific software
GitHub Events
Total
- Release event: 2
- Watch event: 2
- Push event: 5
- Create event: 2
Last Year
- Release event: 2
- Watch event: 2
- Push event: 5
- Create event: 2
Committers
Last synced: about 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Sebastiaan Mathot | s****t@c****l | 521 |
| Julieta | j****o@g****m | 1 |
| pgajdos | p****s@s****z | 1 |
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 15
- Total pull requests: 3
- Average time to close issues: over 1 year
- Average time to close pull requests: 2 months
- Total issue authors: 6
- Total pull request authors: 3
- Average comments per issue: 0.67
- Average comments per pull request: 1.33
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- smathot (10)
- courtneygoodridge (1)
- egaudrain (1)
- dschreij (1)
- JulietaLaurino (1)
- leeweizhe1993 (1)
Pull Request Authors
- JulietaLaurino (1)
- pgajdos (1)
- TrellixVulnTeam (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 2
-
Total downloads:
- pypi 940 last-month
-
Total dependent packages: 7
(may contain duplicates) -
Total dependent repositories: 2
(may contain duplicates) - Total versions: 36
- Total maintainers: 1
pypi.org: datamatrix
This file is part of datamatrix.
- Documentation: https://pydatamatrix.eu
- License: gpl-3.0
-
Latest release: 1.0.16
published 9 months ago
Rankings
Maintainers (1)
conda-forge.org: datamatrix
- Homepage: https://github.com/open-cogsci/datamatrix
- License: GPL-2.0-or-later
-
Latest release: 0.15.3
published over 3 years ago
Rankings
Dependencies
- actions/checkout v3 composite
- actions/setup-python v3 composite
- pypa/gh-action-pypi-publish 27b31702a0e7fc50959f5ad993c78deac1bdfc29 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- json-tricks *
- numpy *
- openpyxl *
- prettytable *
- psutil *
- scipy *
- tomlkit *