# ResampleWithDataset in batch python: output only some columns

**URL:** https://discourse.paraview.org/t/resamplewithdataset-in-batch-python-output-only-some-columns/13189
**Category:** ParaView Support
**Tags:** python
**Created:** [November 4, 2023, 7:38pm UTC](https://discourse.paraview.org/t/resamplewithdataset-in-batch-python-output-only-some-columns/13189 "2023-11-04T19:38:43Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![simonw](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@simonw](https://discourse.paraview.org/u/simonw)
#### Post date: [November 4, 2023, 7:38pm UTC](https://discourse.paraview.org/t/resamplewithdataset-in-batch-python-output-only-some-columns/13189/1 "2023-11-04T19:38:43Z")

</div>

Dear all,

I wrote a python script to interpolate data using the ResampleWithDataset filter. I also want to output the result of the filter in a csv file. Here is what I tried:

```auto

resampleWithDataSet = ResampleWithDataSet(Input = ..., Source = ...)
writer = CreateWriter(myFile.csv, resampleWithDataSet)
writer.UpdatePipeline()

```

This works, but prints all columns, which are  
“u”, “Points:0”, “Points:1”, “Points:2”, and “vtkValidPointMask”.  
What I want is to output only the “u” column.

I thought the PassArrays filter helps and I tried

```auto
resampleWithDataSet = ResampleWithDataSet(Input = ..., Source = ...)
passArrays = PassArrays(resampleWithDataSet)
passArrays.RowDataArray = ['u']
writer = CreateWriter(myFile.csv, passArrays)
writer.UpdatePipeline()

```

But this outputs only “Points:0”, “Points:1”, “Points:2”. Regardless of what I write in  
passArrays.RowDataArray = [‘u’], always the three columns are printed.

So is the PassArrays filer the right filter for outputting only some columns obtained from ResampleWithDataset ?

Thank you!

---

<div class="post-metadata">

### Author: ![simonw](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@simonw](https://discourse.paraview.org/u/simonw)
#### Post date: [November 6, 2023, 8:20am UTC](https://discourse.paraview.org/t/resamplewithdataset-in-batch-python-output-only-some-columns/13189/2 "2023-11-06T08:20:27Z")

</div>

EDIT to my question:

I applied the Pass Arrays filter in the GUI to narrow down my problem and there is not even the possibility to not output the points:

 ![Screenshot at 2023-11-06 09-16-07](https://discourse.paraview.org/uploads/default/original/2X/d/d781dac73f26b3f28775b436453422aedeba48cd.png)

As you can see, I can only uncheck the columns **u** and **vtkValidPointMask** within the Pass Arrays filter. Unchecking the **Points** column is not possible.  
However, what I want is to output only the **u** column.

How can I do this?

---

<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: [November 6, 2023, 9:52am UTC](https://discourse.paraview.org/t/resamplewithdataset-in-batch-python-output-only-some-columns/13189/3 "2023-11-06T09:52:25Z")

</div>

Click on this button: ![a](https://discourse.paraview.org/uploads/default/original/2X/e/ea4b8c7a303658d0c5ab550092cc484ad13ae7ac.png)  
and uncheck the points, then save as csv using this button: ![b](https://discourse.paraview.org/uploads/default/original/2X/5/58b5e87902b777dcf65d6944b7c6e9869ef81a71.png)

---

<div class="post-metadata">

### Author: ![simonw](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@simonw](https://discourse.paraview.org/u/simonw)
#### Post date: [November 6, 2023, 10:29am UTC](https://discourse.paraview.org/t/resamplewithdataset-in-batch-python-output-only-some-columns/13189/4 "2023-11-06T10:29:52Z")

</div>

This is the way to go in the gui, but I have to achieve this with a python script since I do resampling for a bunch of files.

I can “Tools → Start Trace”, do your steps, “Stop Trace”, but this gives like 10-20 lines of script code.

Is there really no easier way to do this in python?

---

<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: [November 6, 2023, 10:38am UTC](https://discourse.paraview.org/t/resamplewithdataset-in-batch-python-output-only-some-columns/13189/5 "2023-11-06T10:38:12Z")

</div>

I’m afraid this is not possible in pvpython sadly. You would need to convert your dataset to a vtkTable but there is no such filter. It would be trivial to add though.

---

<div class="post-metadata">

### Author: ![simonw](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@simonw](https://discourse.paraview.org/u/simonw)
#### Post date: [November 6, 2023, 10:52am UTC](https://discourse.paraview.org/t/resamplewithdataset-in-batch-python-output-only-some-columns/13189/6 "2023-11-06T10:52:27Z")

</div>

I see.

Out of curiosity: Why is the PassArrays filter not working here?

---

<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: [November 6, 2023, 10:54am UTC](https://discourse.paraview.org/t/resamplewithdataset-in-batch-python-output-only-some-columns/13189/7 "2023-11-06T10:54:44Z")

</div>

Because points are not an array in a dataset, they are points. You cant have a dataset without points. You need to convert to a table first, which contain only arrays and no geometry/topology.
