# How to extract the value of a field in Python annotation filter

**URL:** https://discourse.paraview.org/t/how-to-extract-the-value-of-a-field-in-python-annotation-filter/8280
**Category:** ParaView Support
**Created:** [October 28, 2021, 3:14pm UTC](https://discourse.paraview.org/t/how-to-extract-the-value-of-a-field-in-python-annotation-filter/8280 "2021-10-28T15:14:46Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![AE3X](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ae3x/32/7735_2.png) [@AE3X](https://discourse.paraview.org/u/AE3X)
#### Post date: [October 28, 2021, 3:14pm UTC](https://discourse.paraview.org/t/how-to-extract-the-value-of-a-field-in-python-annotation-filter/8280/1 "2021-10-28T15:14:46Z")

</div>

Hello,

Here is what I am trying to do with the **Python Annotation** filter. in Paraview 5.6.0 (on Ubuntu 20.04)

```auto
inputs[0].CellData['myVariable'][0]

```

The output is:

![image](https://discourse.paraview.org/uploads/default/original/2X/6/66496e4eb967c2173798f33946b3a143d490e1ab.png)

I can see the type of of the output as follows:

```auto
type(inputs[0].CellData['myVariable'][0])

```

The output is:  
 ![image](https://discourse.paraview.org/uploads/default/original/2X/a/ae9f4f83acdc1c3f8bd9d4ad1a4dd6f3923f4f61.png)

I want to get the value without the parentheses , i.e: `28.724062`. But when I try:

```auto
inputs[0].CellData['myVariable'][0][0]

```

or

```auto
inputs[0].CellData['myVariable'][0,0]

```

or

```auto
"MyVariable: %6.3f" %(inputs[0].CellData['myVariable'][0])

```

Paraview hangs, and doesn’t respond without displaying any error message (either on the screen or on the terminal). So I am forced to close it from the terminal.

How can I extract the value of my `myVariable` without displaying those parentheses?

Thank you

* * *

* * *

**UPDATE:**

As a workaround I can do the following:

```auto
"My variable: %s" %(str(inputs[0].CellData['myVariable'][0]))

```

![image](https://discourse.paraview.org/uploads/default/original/2X/7/7e1b9604d081606906da4794dba11b8417b838b3.png)

But still can’t get rid of the parentheses around the value.

---

<div class="post-metadata">

### Author: ![pavel](https://discourse.paraview.org/user_avatar/discourse.paraview.org/pavel/32/8287_2.png) [@pavel](https://discourse.paraview.org/u/pavel)
#### Post date: [November 29, 2021, 6:13pm UTC](https://discourse.paraview.org/t/how-to-extract-the-value-of-a-field-in-python-annotation-filter/8280/2 "2021-11-29T18:13:23Z")

</div>

Hi AE3X,

Could you please try “inputs[0].CellData[‘myVariable’].Arrays[0][0]” to firstly get VTKArray from VTKCompositeDataArray? Unfortunately, I don’t have an example with data of \<class 'vtkmodules.numpy\_interface.dataset\_adapter.VTKCompositeDataArray\> to check the idea. For the 'vtkmodules.numpy\_interface.dataset\_adapter.VTKArray\> which I have, expression “inputs[0].CellData[0][0]” works fine and my annotation output has no parentheses.

Hope it helps or guide you to other idea.

Best Regards,  
Pavel
