# calculate cell volumes syntax error

**URL:** https://discourse.paraview.org/t/calculate-cell-volumes-syntax-error/9224
**Category:** ParaView Support
**Created:** [March 18, 2022, 8:29pm UTC](https://discourse.paraview.org/t/calculate-cell-volumes-syntax-error/9224 "2022-03-18T20:29:43Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Qutadah\_Rababah](https://discourse.paraview.org/user_avatar/discourse.paraview.org/qutadah_rababah/32/7033_2.png) [@Qutadah\_Rababah](https://discourse.paraview.org/u/Qutadah_Rababah)
#### Post date: [March 18, 2022, 8:29pm UTC](https://discourse.paraview.org/t/calculate-cell-volumes-syntax-error/9224/1 "2022-03-18T20:29:43Z")

</div>

Hello everyone, I am trying to calculate a ratio of bubble to cell volume in paraview. I found the link where it say I have to add calculator and in the Expression = volume(inputs[0]), which will give me the array of cell volumes, and then I use it with a calculator to find the value, however I receive a syntax error from the inputs[0] and I am not sure what to do, even though there is an array of cell volumes Vc as given from python Calculator, however the Vb array from the calculator is shown.

 ![cellVolumes0](https://discourse.paraview.org/uploads/default/original/2X/1/13f672e2c2ae0163766a11ab580f25fb9a3fa0bd.png)

 ![cellVolumes](https://discourse.paraview.org/uploads/default/original/2X/c/c68f3174bc15fd5dc48adf1c5fc7b1831df04c56.png)

Can someone help ? This is the link I used to calculate cell volumes!

[https://www.paraview.org/Wiki/Python\_calculator\_and\_programmable\_filter](https://www.paraview.org/Wiki/Python_calculator_and_programmable_filter)

Thanks !

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [March 20, 2022, 1:06pm UTC](https://discourse.paraview.org/t/calculate-cell-volumes-syntax-error/9224/2 "2022-03-20T13:06:39Z")

</div>

Since you’re computing cell volume, the resulting array is a cell array. You’ll need to change the **Attribute Type** on the filter from **Point Data** to **Cell Data**.

---

<div class="post-metadata">

### Author: ![Qutadah\_Rababah](https://discourse.paraview.org/user_avatar/discourse.paraview.org/qutadah_rababah/32/7033_2.png) [@Qutadah\_Rababah](https://discourse.paraview.org/u/Qutadah_Rababah)
#### Post date: [March 21, 2022, 2:31am UTC](https://discourse.paraview.org/t/calculate-cell-volumes-syntax-error/9224/3 "2022-03-21T02:31:06Z")

</div>

I did try what you suggested, however do not see the Vb array, I tried setting both **Attribute Type** in the PythonCalculator and Calculator to **Cell Data**. Any idea why is this happening ?

Thanks!

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [March 21, 2022, 11:46am UTC](https://discourse.paraview.org/t/calculate-cell-volumes-syntax-error/9224/4 "2022-03-21T11:46:40Z")

</div>

If you can share the dataset I can see what could be going wrong. I am not sure what would be the issue. Take it one step at a time. Did `Vc` get produced correctly? Confirm in the **Information** panel.

Oh, btw the `Calculator` filter doesn’t need a `=` in the expression. Change `=1/Vc*0....25` to `1/Vc*...`.

---

<div class="post-metadata">

### Author: ![Qutadah\_Rababah](https://discourse.paraview.org/user_avatar/discourse.paraview.org/qutadah_rababah/32/7033_2.png) [@Qutadah\_Rababah](https://discourse.paraview.org/u/Qutadah_Rababah)
#### Post date: [March 21, 2022, 3:25pm UTC](https://discourse.paraview.org/t/calculate-cell-volumes-syntax-error/9224/5 "2022-03-21T15:25:19Z")

</div>

the issue was the equal sign “=”, syntax error and it worked thanks!
