# CSV table data to 3D

**URL:** <https://discourse.paraview.org/t/csv-table-data-to-3d/7858>\
**Category:** ParaView Support\
**Created:** [August 24, 2021, 6:39am UTC](https://discourse.paraview.org/t/csv-table-data-to-3d/7858 "2021-08-24T06:39:58Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Kenichiro-Yoshimi](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/k/ecc23a/32.png) [@Kenichiro-Yoshimi](https://discourse.paraview.org/u/Kenichiro-Yoshimi)\
**Post date:** [August 27, 2021, 8:25am UTC](https://discourse.paraview.org/t/csv-table-data-to-3d/7858/4 "2021-08-27T08:25:33Z")

</div>

One way to achieve this is to use a **Programmable Source**.

1. **Source \> Alphabetical \> Programmable Source**
2. Fill in the **Script (RequestInformation)** as shown below.

```python
from paraview import util
util.SetOutputWholeExtent(self, [0, 98, 0, 37, 0, 0])

```

Here, the values to be specified for **SetOutputWholeExtent** are obtained by counting the number of rows and columns from the csv file in advance.

1. Enter the following in **Script**.

```python
import numpy as np

path = 'data_path/Sample.csv'
a = np.loadtxt(path, delimiter=',', encoding='utf-8_sig').flatten()

output.SetDimensions(99, 38, 1)
output.SetOrigin(0.0, 0.0, 0.0)
output.SetSpacing(1, 1, 1)
output.PointData.append(a, 'height')

```

Here, **path** is the absolute path to the location of Sample.csv. And set the number of rows and columns in the csv file in **output.SetDimensions**.

1. Specify **vtkImageData** as the **Output Data Set Type**.

2. Apply

3. Continue to apply **Filters \> Alphabetical \> Warp By Scalar** , as shown below.

 ![programmable_source](https://discourse.paraview.org/uploads/default/original/2X/2/2cf966a87a4fa4abed9c9bed25c6233314c2da75.png)

The state file for the above operations is attached.  
[programmable\_source.pvsm](https://discourse.paraview.org/uploads/short-url/gg2hG5vDC3seZF29CLlb9dMBjLS.pvsm) (292.2 KB)

---

_[View the full topic](https://discourse.paraview.org/t/csv-table-data-to-3d/7858)._
