# Handling of NaNs in Table to points filter

**URL:** https://discourse.paraview.org/t/handling-of-nans-in-table-to-points-filter/11198
**Category:** ParaView Support
**Created:** [January 18, 2023, 10:27am UTC](https://discourse.paraview.org/t/handling-of-nans-in-table-to-points-filter/11198 "2023-01-18T10:27:41Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![fra](https://discourse.paraview.org/user_avatar/discourse.paraview.org/fra/32/6678_2.png) [@fra](https://discourse.paraview.org/u/fra)
#### Post date: [January 18, 2023, 10:27am UTC](https://discourse.paraview.org/t/handling-of-nans-in-table-to-points-filter/11198/1 "2023-01-18T10:27:41Z")

</div>

Hi,  
I have a series of CSV files containing several columns, including the xyz coordinates. Due to the way I generate them, some of them contain NaN in one of the coordinates, which makes the Table to points filter fail. Since it’s only some points who do this, I’d like to just skip them upon reading/applying the filter. Is there a way to implement this behavior without having to manually clean the files (thousands of them…)?

---

<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: [January 18, 2023, 10:30am UTC](https://discourse.paraview.org/t/handling-of-nans-in-table-to-points-filter/11198/2 "2023-01-18T10:30:51Z")

</div>

Please share a example dataset

---

<div class="post-metadata">

### Author: ![fra](https://discourse.paraview.org/user_avatar/discourse.paraview.org/fra/32/6678_2.png) [@fra](https://discourse.paraview.org/u/fra)
#### Post date: [January 18, 2023, 10:36am UTC](https://discourse.paraview.org/t/handling-of-nans-in-table-to-points-filter/11198/3 "2023-01-18T10:36:42Z")

</div>

Here you have an example. The coordinates columns are x, y and z. As you can see, some of them contain the string “nan”, which makes the filter fail.  
[platelets4.csv](https://discourse.paraview.org/uploads/short-url/gtJ0EmKnk5IxMpn3VfZ9ea2uLzz.csv) (145.3 KB)

---

<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: [January 18, 2023, 1:07pm UTC](https://discourse.paraview.org/t/handling-of-nans-in-table-to-points-filter/11198/4 "2023-01-18T13:07:43Z")

</div>

I confirm that it fails to read the .csv as expected (with actual NaN instead of the “NaN” string). Please open an issue: [https://gitlab.kitware.com/paraview/paraview/-/issues](https://gitlab.kitware.com/paraview/paraview/-/issues)

---

<div class="post-metadata">

### Author: ![fra](https://discourse.paraview.org/user_avatar/discourse.paraview.org/fra/32/6678_2.png) [@fra](https://discourse.paraview.org/u/fra)
#### Post date: [January 18, 2023, 1:25pm UTC](https://discourse.paraview.org/t/handling-of-nans-in-table-to-points-filter/11198/5 "2023-01-18T13:25:41Z")

</div>

I will!

In the meantime, do you think there might be a way to use a Programmable filter to “embed” the Table to points and make it skip the NaNs?

---

<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: [January 18, 2023, 1:29pm UTC](https://discourse.paraview.org/t/handling-of-nans-in-table-to-points-filter/11198/6 "2023-01-18T13:29:51Z")

</div>

Using a ProgrammableSource, you should indeed be able to read the .csv yourself and create a vtkTable with the right data.

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [January 18, 2023, 4:30pm UTC](https://discourse.paraview.org/t/handling-of-nans-in-table-to-points-filter/11198/7 "2023-01-18T16:30:04Z")

</div>

You can also filter out the NaNs with a selection operation.

The following is with ParaView 5.11.0. Open the Find Data panel, set the Data Producer to the CSV file reader, pick one of the coordinate columns and set the find criteria to “is NaN”. Click the Invert Selection and you’ll have selected all rows without NaN coordinates. Click the _Extract_ button to extract a table with rows that don’t have the NaN points.

 ![image](https://discourse.paraview.org/uploads/default/original/2X/0/0dcc44cc709662b08e7d7733b51e0e0ba532d6c0.png)
