In [2]:
!ls


Fremont.csv           LICENSE               Untitled.ipynb
Import Daq File.ipynb Set1.mat              untitled.txt

In [13]:
import numpy as np
from scipy.io import loadmat  # this is the SciPy module that loads mat-files
import matplotlib.pyplot as plt
from datetime import datetime, date, time
import pandas as pd

mat = loadmat('Set1.mat')  # load mat-file
#mdata = mat['daq']  # variable in mat file
#mdtype = mdata.dtype  # dtypes of structures are "unsized objects"
# * SciPy reads in structures as structured NumPy arrays of dtype object
# * The size of the array is the size of the structure array, not the number
#   elements in any particular field. The shape defaults to 2-dimensional.
# * For convenience make a dictionary of the data using the names from dtypes
# * Since the structure has only one element, but is 2-D, index it at [0, 0]
#ndata = {n: mdata[n][0, 0] for n in mdtype.names}
# Reconstruct the columns of the data table from just the time series
# Use the number of intervals to test if a field is a column or metadata
#columns = [n for n, v in ndata.iteritems() if v.size == ndata['numIntervals']]
# now make a data frame, setting the time stamps as the index
#df = pd.DataFrame(np.concatenate([ndata[c] for c in columns], axis=1),
#                  index=[datetime(*ts) for ts in ndata['timestamps']],
#                  columns=columns)


---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
<ipython-input-13-4aff29ce34b9> in <module>()
      5 import pandas as pd
      6 
----> 7 mat = loadmat('Set1.mat')  # load mat-file
      8 #mdata = mat['daq']  # variable in mat file
      9 #mdtype = mdata.dtype  # dtypes of structures are "unsized objects"

/Users/Jeff/anaconda/lib/python3.6/site-packages/scipy/io/matlab/mio.py in loadmat(file_name, mdict, appendmat, **kwargs)
    133     """
    134     variable_names = kwargs.pop('variable_names', None)
--> 135     MR = mat_reader_factory(file_name, appendmat, **kwargs)
    136     matfile_dict = MR.get_variables(variable_names)
    137     if mdict is not None:

/Users/Jeff/anaconda/lib/python3.6/site-packages/scipy/io/matlab/mio.py in mat_reader_factory(file_name, appendmat, **kwargs)
     63         return MatFile5Reader(byte_stream, **kwargs)
     64     elif mjv == 2:
---> 65         raise NotImplementedError('Please use HDF reader for matlab v7.3 files')
     66     else:
     67         raise TypeError('Did not recognize version %s' % mjv)

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

In [ ]:


In [ ]: