# Vectors in Programmable Filter

**URL:** https://discourse.paraview.org/t/vectors-in-programmable-filter/7645
**Category:** ParaView Support
**Created:** [July 19, 2021, 4:40pm UTC](https://discourse.paraview.org/t/vectors-in-programmable-filter/7645 "2021-07-19T16:40:22Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![gizem](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/g/7ea924/32.png) [@gizem](https://discourse.paraview.org/u/gizem)
#### Post date: [July 19, 2021, 4:40pm UTC](https://discourse.paraview.org/t/vectors-in-programmable-filter/7645/1 "2021-07-19T16:40:22Z")

</div>

Hello,  
I am trying to use the first component of a vector via Programmable Filter.  
I tried follwing:  
input = inputs[0]  
pointData = input.GetPointData()  
vector = pointData.GetVectors(‘vector’)

Now this creates a double array. The ‘vector’ has three components and I’d like to only work with the x-coordinate.  
I tried working on the coordinates directly, without using the full vector, but this always returned the value None.  
Since I am working on Particles, I could use their ID: coordinates = vector.GetTuple(-ParticleID-), but this gives back all three coordinates. Also, is there a way to extract the components without having to use the ID of the Particle? I’d like to print out the x-coordinates of each Particle.

I’d be thankful for any advice.

---

<div class="post-metadata">

### Author: ![Kenichiro-Yoshimi](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/k/ecc23a/32.png) [@Kenichiro-Yoshimi](https://discourse.paraview.org/u/Kenichiro-Yoshimi)
#### Post date: [July 20, 2021, 11:19am UTC](https://discourse.paraview.org/t/vectors-in-programmable-filter/7645/2 "2021-07-20T11:19:13Z")

</div>

By extracting the array as a numpy array, it would be possible to extract only the x-components.

```python
input = inputs[0]
vector = input.PointData['vector']
print(vector[:,0])

```

---

<div class="post-metadata">

### Author: ![gizem](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/g/7ea924/32.png) [@gizem](https://discourse.paraview.org/u/gizem)
#### Post date: [July 20, 2021, 1:37pm UTC](https://discourse.paraview.org/t/vectors-in-programmable-filter/7645/3 "2021-07-20T13:37:31Z")

</div>

That worked. Thank you very much!!
