0

By mistake I used numpy array over a set to save my result. The run was time-consuming and it is hard to repeat it. It seems something is stored in the variable, but how can I retrieve the elements inside it?

To simplify, I did something like

#import numpy as np
result = np.array({1,2,3,4})

Now how can I access the elements (i.e., 1,2,3,4) in result?

0

1 Answer 1

0

The only "problem" here is that your array is a scalar (otherwise you could use result[0]). In this case you can simply use result.item().

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

1 Comment

Cool. It works. Thanks.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.