# Using ResampleWithDataSet in a Python script

**URL:** https://discourse.paraview.org/t/using-resamplewithdataset-in-a-python-script/7465
**Category:** ParaView Support
**Tags:** python, vtk
**Created:** [June 22, 2021, 5:26pm UTC](https://discourse.paraview.org/t/using-resamplewithdataset-in-a-python-script/7465 "2021-06-22T17:26:29Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Aroma](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/eb9ed0/32.png) [@Aroma](https://discourse.paraview.org/u/Aroma)
#### Post date: [June 22, 2021, 5:26pm UTC](https://discourse.paraview.org/t/using-resamplewithdataset-in-a-python-script/7465/1 "2021-06-22T17:26:29Z")

</div>

Hi,  
I have a python script and would like to resample my vtk 2D results to an array of 100 points with x, y, and z (z=0 for all). I’d like to use ResampleWithDataSet, but I am getting errors. Can you please help me to find out my mistake?

I appreciate your kind help.  
My code is as follows

```auto
from paraview import numpy_support as ns
from paraview.simple import *

DesPoints = points # points = [[x1,y1,z1],[x2,y2,z2],.....,[x100,y100,z100]]
probeResults = []
reader = OpenDataFile()
probe = ResampleWithDataSet(SourceDataArray=reader, DestinationMesh=DesPoints)
reader.FileNames = file_path #.\file.vtk
probe.UpdatePipeline()
data = servermanager.Fetch(probe)
probeResults.append(ns.vtk_to_numpy(data.GetPointData().GetArray()))

```
