# Take random sample of data

**URL:** https://discourse.paraview.org/t/take-random-sample-of-data/8220
**Category:** ParaView Support
**Tags:** python
**Created:** [October 19, 2021, 2:05pm UTC](https://discourse.paraview.org/t/take-random-sample-of-data/8220 "2021-10-19T14:05:06Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![massisenergy](https://discourse.paraview.org/user_avatar/discourse.paraview.org/massisenergy/32/6229_2.png) [@massisenergy](https://discourse.paraview.org/u/massisenergy)
#### Post date: [October 19, 2021, 2:05pm UTC](https://discourse.paraview.org/t/take-random-sample-of-data/8220/1 "2021-10-19T14:05:06Z")

</div>

I have a `vtk pointData` set, where there are too many points / spheres to visualize at once. Is there a filter for randomly sampling the dataset, say only half of the points can be made visible?

A programmable filter would be nice but there is no function called `sample()` as in python. How do I get to know about it?

---

<div class="post-metadata">

### Author: ![theodorebaltis](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/e480ec/32.png) [@theodorebaltis](https://discourse.paraview.org/u/theodorebaltis)
#### Post date: [October 19, 2021, 2:53pm UTC](https://discourse.paraview.org/t/take-random-sample-of-data/8220/2 "2021-10-19T14:53:03Z")

</div>

I believe `MaskPoints` is what you need. There are a few options for defining how to sub-sample your dataset.
