Skip to main content

Load MATLAB .mat 7.3 into Python native data types

Project description

Python package

mat 7.3

Load MATLAB 7.3 .mat files into Python.

Starting with MATLAB 7.3, .mat files have been changed to store as custom hdf5 files. This means they cannot be loaded by scipy.io.loadmat any longer and raise.

NotImplementedError: Please use HDF reader for matlab v7.3 files

Quickstart

This library loads MATLAB 7.3 HDF5 files into a Python dictionary.

import mat73
data_dict = mat73.loadmat('data.mat')

As easy as that!

Installation

To install, run:

pip install mat73

Alternatively for most recent version:

pip install git+https://github.com/skjerns/mat7.3

Datatypes

The following MATLAB datatypes can be loaded

MATLAB Python
logical np.bool_
single np.float32
double np.float64
int8/16/32/64 np.int8/16/32/64
uint8/16/32/64 np.uint8/16/32/64
complex np.complex128
char str
struct dict
cell list
canonical empty []
Other (ie Datetime, ...) Not supported

Short-comings

  • This library will only load mat 7.3 files. For older versions use scipy.io.loadmat
  • Proprietary MATLAB types (e.g datetime, duriation, etc) are not supported. If someone tells me how to convert them, I'll implement that
  • For now, you can't save anything back to the .mat. Let me know if you need this functionality, would be quick to implement.
  • See also hdf5storage, which can indeed be used for saving .mat, but has less features for loading

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

mat73-0.45.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mat73-0.45-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file mat73-0.45.tar.gz.

File metadata

  • Download URL: mat73-0.45.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for mat73-0.45.tar.gz
Algorithm Hash digest
SHA256 fcdb85517f29053a103c739379b78d3d9b5a9f844e968d4947d2805e6a138eaa
MD5 7016d6af1d3e41fd483b3919339ad7fa
BLAKE2b-256 b50458063f92f690aab447a7baf6b2a7c019b728ec6d9d917fde76b33134b1c9

See more details on using hashes here.

File details

Details for the file mat73-0.45-py3-none-any.whl.

File metadata

  • Download URL: mat73-0.45-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for mat73-0.45-py3-none-any.whl
Algorithm Hash digest
SHA256 ec9e20a8b4dd3e6678c5c17e8bfe7316081978c14f7588d37dd1e9a939ae5e6b
MD5 019b2bd5857fcf5f8ace795ddafbe5cc
BLAKE2b-256 95f4175fd094d338c5eb3b338268a301a1109c72f9ed92fa6783cdbded5de40b

See more details on using hashes here.

Supported by

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