0

How do I return dictionary values with .values()? 'dict_values' object is not subscriptable, so I cannot use dict.values()[0] to retrieve the first array [2.96762712e+03, 8.38541299e-01, 1.32466671e-02]

dict_values([array([2.96762712e+03, 8.38541299e-01, 1.32466671e-02]), array([2.96762712e+03, 8.38541299e-01, 1.32466671e-02]), array([2.96762712e+03, 8.38541299e-01, 1.32466671e-02]), array([2.96762712e+03, 8.38541299e-01, 1.32466671e-02])])
1

1 Answer 1

1

Convert to list prior to indexing:

list(dict.values())[0]
Sign up to request clarification or add additional context in comments.

Comments

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.