bundles / scipy latest / scipy / io / matlab / _mio / mat_reader_factory
function
scipy.io.matlab._mio:mat_reader_factory
source: /scipy/io/matlab/_mio.py :52
Signature
def mat_reader_factory ( file_name , appendmat = True , ** kwargs ) Summary
Create reader for matlab .mat format files.
Parameters
file_name: strName of the mat file (do not need .mat extension if appendmat==True) Can also pass open file-like object.
appendmat: bool, optionalTrue to append the .mat extension to the end of the given filename, if not already present. Default is True.
byte_order: str or None, optionalNone by default, implying byte order guessed from mat file. Otherwise can be one of ('native', '=', 'little', '<', 'BIG', '>').
mat_dtype: bool, optionalIf True, return arrays in same dtype as would be loaded into MATLAB (instead of the dtype with which they are saved).
squeeze_me: bool, optionalWhether to squeeze unit matrix dimensions or not.
chars_as_strings: bool, optionalWhether to convert char arrays to string arrays.
matlab_compatible: bool, optionalReturns matrices as would be loaded by MATLAB (implies squeeze_me=False, chars_as_strings=False, mat_dtype=True, struct_as_record=True).
struct_as_record: bool, optionalWhether to load MATLAB structs as NumPy record arrays, or as old-style NumPy arrays with dtype=object. Setting this flag to False replicates the behavior of SciPy version 0.7.x (returning numpy object arrays). The default setting is True, because it allows easier round-trip load and save of MATLAB files.
Returns
matreader: MatFileReader objectInitialized instance of MatFileReader class matching the mat file type detected in
filename.file_opened: boolWhether the file was opened by this routine.
Aliases
-
scipy.io.matlab._mio.mat_reader_factory