# Export Descriptive statitistics to python

**URL:** https://discourse.paraview.org/t/export-descriptive-statitistics-to-python/7079
**Category:** ParaView Support
**Created:** [April 27, 2021, 4:08am UTC](https://discourse.paraview.org/t/export-descriptive-statitistics-to-python/7079 "2021-04-27T04:08:35Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Thomas](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/e36b37/32.png) [@Thomas](https://discourse.paraview.org/u/Thomas)
#### Post date: [April 27, 2021, 4:08am UTC](https://discourse.paraview.org/t/export-descriptive-statitistics-to-python/7079/1 "2021-04-27T04:08:36Z")

</div>

Good day,

I am taking multiple slices through my data and then want to calculate the mean and standard deviation for each slice. I then want to plot the mean and STD against the position of the slice. For this I would prefer to extract the descriptive statistics to python where I would combine the data for plotting.

Within paraview, I see the data I am interested in is located under the attribute ‘Row Data’ in the spreadsheet view. Currently, the only way I can see to get this data out is to export the spreadsheet view to csv file and manipulate the data from there. This is a cumbersome approach.

Is there a better way to get the statistics into python? I have tried servermanager.fetch(‘DescriptiveStatistics1’) but I can’t see how to get the data from there.

Thanks for the help  
Thomas

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [April 27, 2021, 7:51am UTC](https://discourse.paraview.org/t/export-descriptive-statitistics-to-python/7079/2 "2021-04-27T07:51:20Z")

</div>

A few approaches are possible:

1. Use “DescriptiveStatistics” filter (server side)
2. Use servermanager.Fetch in a pvpython script (client side)
3. Write your own ProgrammableFilter script (server side)

---

<div class="post-metadata">

### Author: ![Thomas](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/e36b37/32.png) [@Thomas](https://discourse.paraview.org/u/Thomas)
#### Post date: [April 27, 2021, 10:16am UTC](https://discourse.paraview.org/t/export-descriptive-statitistics-to-python/7079/3 "2021-04-27T10:16:25Z")

</div>

Hi Mathieu,

Thanks for the advice.

> [@mwestphal](#):
>
> - Use “DescriptiveStatistics” filter (server side)
> - Use servermanager.Fetch in a pvpython script (client side)

I have tried your points 1 & 2, but in both cases I can not get the values for Max, Min, Mean, M2, M3, M4 into python. The best I can do is view them in the spreadsheet view under ‘Row Data’ within python. If the data was point data, it would be easy to get with the GetPointData method, but no similar method seems to exist for Row Data. Is there a method that I am missing that would allow me to get these values into python?

> [@mwestphal](#):
>
> Write your own ProgrammableFilter script (server side)

I have never used programmable filters and it seems somewhat daunting. I have spent some time today attempting to use the programmable filter and am able to calculate the standard devuatuib. I am currently using a vtkTable as an output data set type and using output.RowData.append. With this I can view my result in the spreadsheet view under RowData but again I am unable to extract the result.

As you can see, my problem seems to be the extraction of the data rather than the calculation. Can you advise me on the next step?

Thanks again for your help!  
Thomas

---

<div class="post-metadata">

### Author: ![Xabier\_Morales\_Ferez](https://discourse.paraview.org/user_avatar/discourse.paraview.org/xabier_morales_ferez/32/2890_2.png) [@Xabier\_Morales\_Ferez](https://discourse.paraview.org/u/Xabier_Morales_Ferez)
#### Post date: [February 23, 2022, 6:19pm UTC](https://discourse.paraview.org/t/export-descriptive-statitistics-to-python/7079/4 "2022-02-23T18:19:42Z")

</div>

I’m also struggling with the same issue. What method do we need to employ after servermanager.Fetch to retrieve the Row Data?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 24, 2022, 9:07am UTC](https://discourse.paraview.org/t/export-descriptive-statitistics-to-python/7079/5 "2022-02-24T09:07:26Z")

</div>

Please open your own topic.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 24, 2022, 9:07am UTC](https://discourse.paraview.org/t/export-descriptive-statitistics-to-python/7079/6 "2022-02-24T09:07:29Z")

</div>


