# numpy clip not working in programmable filter

**URL:** https://discourse.paraview.org/t/numpy-clip-not-working-in-programmable-filter/11547
**Category:** ParaView Support
**Tags:** python
**Created:** [March 1, 2023, 10:59pm UTC](https://discourse.paraview.org/t/numpy-clip-not-working-in-programmable-filter/11547 "2023-03-01T22:59:42Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sing0673](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/ecae2f/32.png) [@sing0673](https://discourse.paraview.org/u/sing0673)
#### Post date: [March 1, 2023, 10:59pm UTC](https://discourse.paraview.org/t/numpy-clip-not-working-in-programmable-filter/11547/1 "2023-03-01T22:59:42Z")

</div>

I am trying to use numpy in programmable filter. I can do other operations such as divide, converting list to numpy array etc., but numpy clip does not work. It does not throw any error but I see that numpy clip has no effect. Does anyone has any idea what might be wrong. Here is the python code that I am using in the programmable filter

```auto
import numpy as np
input0=inputs[0]
rho=np.array(input0.CellData['rho'])
data['u'] = np.clip(np.divide(input0.CellData['rho_u'],rho),0.1,0.4)
output.CellData.append(data['u'], "u")

```

---

<div class="post-metadata">

### Author: ![Hendrice](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/h/e274bd/32.png) [@Hendrice](https://discourse.paraview.org/u/Hendrice)
#### Post date: [October 6, 2023, 3:18pm UTC](https://discourse.paraview.org/t/numpy-clip-not-working-in-programmable-filter/11547/2 "2023-10-06T15:18:49Z")

</div>

Hi there,  
I’m experiencing the same issue. I tried to boil it down to the underlying functionality which is

```auto
np.minimum(a_max, np.maximum(a, a_min))

```

So it seems that the `min` and `max` functions from

```auto
from vtk.numpy_interface import algorithms as algs

```

do not take a second array or scalar as argument. Is this a bug or did I miss somthing?  
Regards,  
Hendrik
