1

This is a pretty easy question, I was wondering how to decipher this array:

model[Best[i][j]][6]

Is it recreating another array based off of the 'Best' array within the brackets? I'm not sure how to translate this to myself.

1 Answer 1

2

If we are talking about numpy arrays, this will return the value of array model positioned at Best[i][j] (this should be a number perhaps from another array) row and 6th column. Here is an example:

import numpy as np
model = np.array([[1,2],[3,4]])
Best  = np.array([[0,0],[1,1]])

i = 0   # Best[i][j] is 0
j = 1

print model[Best[i][j]][1] # It prints model[0][1], which is 2
Sign up to request clarification or add additional context in comments.

1 Comment

Great. That's sorta what I thought it was, I was just looking for clarification. Thanks.

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.