# Why would vtkXMLPolyDataReader not also read scalar arrays?

**URL:** https://discourse.vtk.org/t/why-would-vtkxmlpolydatareader-not-also-read-scalar-arrays/14259
**Category:** Support
**Created:** [July 19, 2024, 1:30pm UTC](https://discourse.vtk.org/t/why-would-vtkxmlpolydatareader-not-also-read-scalar-arrays/14259 "2024-07-19T13:30:37Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![rexthor](https://discourse.vtk.org/user_avatar/discourse.vtk.org/rexthor/32/6481_2.png) [@rexthor](https://discourse.vtk.org/u/rexthor)
#### Post date: [July 19, 2024, 1:30pm UTC](https://discourse.vtk.org/t/why-would-vtkxmlpolydatareader-not-also-read-scalar-arrays/14259/1 "2024-07-19T13:30:38Z")

</div>

I don’t often use the visualization pipeline in VTK, so sorry if this is silly.

I have a datafile that has a “Temperature” array in point data - I can see it in ParaVew, but when I read it in via a Python script, no arrays show up?

```python
from vtkmodules.vtkIOXML import vtkXMLPolyDataReader

r = vtkXMLPolyDataReader()
r.SetFileName("I_have_temperature_I_promise.vtp")
pd = r.GetOutput()
print(f"pd.GetPointData().GetNumberOfArrays(): {pd.GetPointData().GetNumberOfArrays()}")
print(f"pd.GetPointData().GetArrayName(0): {pd.GetPointData().GetArrayName(0)}")

```

output:

```auto
pd.GetPointData().GetNumberOfArrays(): 0
pd.GetPointData().GetArrayName(0): None

```

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cory.quammen/32/6751_2.png) [@cory.quammen](https://discourse.vtk.org/u/cory.quammen)
#### Post date: [July 19, 2024, 2:04pm UTC](https://discourse.vtk.org/t/why-would-vtkxmlpolydatareader-not-also-read-scalar-arrays/14259/2 "2024-07-19T14:04:30Z")

</div>

After you call `r.SetFileName(...)`, call `r.Update()`. That will cause the file to be read and you should see your arrays.
