views:

38

answers:

1

The data-element is a float-number and no sequence (I think). But I get the error "setting an array element with a sequence".

folder = r"C:\Dokumente und Einstellungen\ssc"
contents=os.listdir(folder)

ar = zeros((81,81,256),int)
filenumber = 0

for d in contents:
    if str(".bin") in d:
        filename = os.path.join("C:\\Dokumente und Einstellungen\\ssc\\" + d)
    print filename
    c_file = open(filename,"rb")
    for k in range(8): #81
        for m in range(2): #256
            data = unpack('d',c_file.read(8))[0]
            print data
            ar[filename,k,m] = data
    filenumber += 1
+1  A: 

Do you mean ar[filenumber,k,m] = data? I don't think you can index it with filename.

ptomato
should I delete this question?
kame
@kame: That's up to you I suppose, I don't know of any guidelines that say you have to delete typo questions...
ptomato
@kame: Typo questions are common. Many programmers stare at the same variables for hours not realizing they're they wrong variable. It takes other eyes to see the obvious. But you won't get much reputation from a bad question like this.
S.Lott