Skip to main content

search and extract field names or variables from MATLAB .mat files and return a pandas Dataframe

Project description

matgrab

Search and extract field names or variables from MATLAB .mat files and return a pandas Dataframe

installation

PYPI

pip install matgrab

usage

python

import matgrab
df = matgrab.mat2df("PATH","VARS")

PATH may be a file path, directory path, or list of either VARS may be a string or list of strings that correspond to field names of desired matlab variables

if your desired data is nested within another named data structure or array, that structure name must proceed the desired variable separated by a "."

EEG.mat
├── dataset_description {string}
└── sub-D0048 {struct}
    ├── anat {struct}
    │   ├── T1w {string}
    │   └── CT {float}
    └── ieeg {array}
        ├── channels {column}
        └── values {column}

To retrieve the values from the above mat file, the command would be:

matgrab.mat2df("EEG.mat",["sub-D0048.anat.T1w","sub-D0048.anat.CT","sub-D0048.ieeg.channels","sub-D0048.ieeg.values"])

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

matgrab-0.1.0.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

matgrab-0.1.0-py3-none-any.whl (3.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page