0

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 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

3 Comments

should I delete this question?
@kame: That's up to you I suppose, I don't know of any guidelines that say you have to delete typo questions...
@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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.