Sorry...and thanks again Robert. I forgot to add the .data to the key. This really works. #!/usr/bin/env python from numpy import * index = {} ar = [ [2,3], [5,4]] for a in ar: key = array(a, dtype=uint8) key.flags.writeable = False index[key.data] = len(index) for data in index: dum = frombuffer(data,dtype=uint8) print dum