I am quite new to Python and thus struggling with its structures. Please ignore my silliness. I tried my best to find a solution but failed so far.

I have a set "self.gamma" which looks like

```
{<pomdpy.solvers.alpha_vector.AlphaVector object at 0x0000015E7B5F8908>, <pomdpy.solvers.alpha_vector.AlphaVector object at 0x0000015E7B5F8E48>, <pomdpy.solvers.alpha_vector.AlphaVector object at 0x0000015E7B5F8948>
```

I want to access its elements and I can do it this way:

```
[av.v for av in self.gamma]
[av.action for av in self.gamma]
```

which gives

```
[array([-95. , 9.5]), array([ 9.5, -95. ]), array([-0.95, -0.95])]
[1, 2, 0]
```

respectively. There are two types of data in the set – "v" (short for value) and "actions". Here is what I want to do:

- Do what I did without the for loop
- Access individual arrays from within self.gamma, e.g., self.gamma.v[0] should give me array([-95. , 9.5])

I hope I was clear with my question. Thank you in advance!

Stack Overflow Asked by lost_and_found on November 15, 2021

0 Answers1 Asked on September 14, 2020 by leoness

2 Asked on September 14, 2020 by miciobauciao

1 Asked on September 13, 2020 by always-prog

0 Asked on September 13, 2020 by edgar-torres

3 Asked on September 13, 2020 by pratik-goud

1 Asked on September 12, 2020 by ricardo

1 Asked on September 11, 2020 by frececroka

3 Asked on September 11, 2020 by joji

1 Asked on September 10, 2020 by a-p-jo

1 Asked on September 10, 2020 by codependent

apache kafka streams spring boot spring cloud stream spring cloud stream binder kafka

1 Asked on September 10, 2020 by th3g3ntl3man

1 Asked on September 9, 2020 by bers

1 Asked on September 9, 2020 by pleasant-nightmares

0 Asked on September 8, 2020 by googra-heeljat

2 Asked on September 8, 2020 by olaf-svenson

Get help from others!

Recent Questions

- Solving $ 2(2^x- 1) x^2 + (2^{x^2}-2)x = 2^{x+1} -2$
- Do Approximate Eigenvalues Imply Approximate Eigenvectors?
- Constraints on $x^2 + b x + c = 0$ such that at least one root has a positive real part
- Picking the set of coset representatives of a stabilizer under a group action
- Write condition if rectangle is inside another rectangle

Recent Answers

- Michael Rozenberg on Solving $ 2(2^x- 1) x^2 + (2^{x^2}-2)x = 2^{x+1} -2$
- lab bhattacharjee on Constraints on $x^2 + b x + c = 0$ such that at least one root has a positive real part
- copper.hat on Do Approximate Eigenvalues Imply Approximate Eigenvectors?
- Robert Israel on Do Approximate Eigenvalues Imply Approximate Eigenvectors?
- OlympusHero on Solving $ 2(2^x- 1) x^2 + (2^{x^2}-2)x = 2^{x+1} -2$

© 2021 InsideDarkWeb.com. All rights reserved.