[Numpy-discussion] numpy errors on MacOS but works on Ubuntu

Håkan Jonsson hajons at gmail.com
Thu Dec 22 17:21:28 EST 2011


I am running the same code on Ubuntu 10.04 and MacOS 10.7 with different results.
On Ubuntu, it reads a dataset from a .mat Matlab file, 
and then tries to access specific values. 
On MacOS I get:

Done loading matlab data.
Traceback (most recent call last):
  File "parse_proximity.py", line 79, in <module>
  File "parse_proximity.py", line 18, in get_events
    subject_mac = int(subject_object.my_mac[0][0][0], 16)
AttributeError: 'numpy.void' object has no attribute 'my_mac'

The code looks like this:

import scipy.io
from datetime import datetime, timedelta
import time
import sys, os

start_date = 1095984000
end_date = 1096004000

def get_events(matlab_obj):
    subjects = matlab_obj["s"][0]
    for subject_object in subjects:
        valid = True
            subject_mac = int(subject_object.my_mac[0][0][0], 16)

if __name__ == "__main__":
    matlab_filename = sys.argv[1]
    matlab_obj = scipy.io.loadmat(matlab_filename)
    print "Done loading matlab data."

I have tried two different versions of python 2.6.1 and 
2.7.1 with same results. 
I don't have any other problems with using python on MacOS.

Any suggestions?


More information about the NumPy-Discussion mailing list