# Vector component in Python Calculator

**URL:** https://discourse.paraview.org/t/vector-component-in-python-calculator/4030
**Category:** ParaView Support
**Tags:** python
**Created:** [April 11, 2020, 4:32pm UTC](https://discourse.paraview.org/t/vector-component-in-python-calculator/4030 "2020-04-11T16:32:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![CapLek](https://discourse.paraview.org/user_avatar/discourse.paraview.org/caplek/32/3430_2.png) [@CapLek](https://discourse.paraview.org/u/CapLek)
#### Post date: [April 11, 2020, 4:32pm UTC](https://discourse.paraview.org/t/vector-component-in-python-calculator/4030/1 "2020-04-11T16:32:15Z")

</div>

Is there a possibility to select a vector component (or scalar, if you want) for processing in Python Calculator filter? In Calculator it’s possible through the special notation, for example to work with X component of displacement I need to type _Displacement\_X_. The same thing does not work for Python Calculator.

What I need to do is to calculate the gradient of Displacement X component. What would be the correct expression for that? Thank you.

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [April 13, 2020, 3:10pm UTC](https://discourse.paraview.org/t/vector-component-in-python-calculator/4030/2 "2020-04-13T15:10:18Z")

</div>

You can access the 0-th component of an array named `Normals` with `Normals[:,0]`.

---

<div class="post-metadata">

### Author: ![maryha](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/ce7236/32.png) [@maryha](https://discourse.paraview.org/u/maryha)
#### Post date: [February 10, 2021, 8:39pm UTC](https://discourse.paraview.org/t/vector-component-in-python-calculator/4030/3 "2021-02-10T20:39:26Z")

</div>

Hello,

I tried to access the first component of a tensor named `sigma`. But when I try this: `sigma[0,0].rename("sigma[0,0]", "xx")`, I get `AttributeError: 'Indexed' object has no attribute 'rename'`  
Can you please tell me how I can rename arrays of a tensor?

Thank you so much!
