# How to use vtkTemporalStatistics?

**URL:** https://discourse.vtk.org/t/how-to-use-vtktemporalstatistics/3289
**Category:** Support
**Created:** [May 12, 2020, 8:40pm UTC](https://discourse.vtk.org/t/how-to-use-vtktemporalstatistics/3289 "2020-05-12T20:40:54Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![myousefi2016](https://discourse.vtk.org/user_avatar/discourse.vtk.org/myousefi2016/32/921_2.png) [@myousefi2016](https://discourse.vtk.org/u/myousefi2016)
#### Post date: [May 12, 2020, 8:40pm UTC](https://discourse.vtk.org/t/how-to-use-vtktemporalstatistics/3289/1 "2020-05-12T20:40:54Z")

</div>

I’m trying to use `vtkTemporalStatistics` in python. Basically I have several `vtkUnstructuredGrid` objects and I want to feed them into `vtkTemporalStatistics` to take time-average over them. I’m not sure how to feed each time-step into the `vtkTemporalStatistics` class. Is it correct to use it this way?

```auto
temporalStatisticsFilter = vtk.vtkTemporalStatistics()
temporalStatisticsFilter.ComputeAverageOn()
for vtu in VTUs:
    temporalStatisticsFilter.SetInputData(vtu)
temporalStatisticsFilter.Update()

```

Where `VTUs` is the list of `vtkUnstructuredGrid` objects.
