# Numpy array, what is that?

**URL:** <https://discourse.slicer.org/t/numpy-array-what-is-that/17727>\
**Category:** Support\
**Created:** [May 21, 2021, 8:06pm UTC](https://discourse.slicer.org/t/numpy-array-what-is-that/17727 "2021-05-21T20:06:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![NoobForSlicer](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/noobforslicer/32/10900_2.png) [@NoobForSlicer](https://discourse.slicer.org/u/NoobForSlicer)\
**Post date:** [May 21, 2021, 8:06pm UTC](https://discourse.slicer.org/t/numpy-array-what-is-that/17727/1 "2021-05-21T20:06:31Z")

</div>

So I was reading a lot about things in scripts depository. I just learned how to change the background color to white and I am interested to learn more about python in general.

I read a lot and a word 'numpy array" keeps coming up.

What is a “numpy array”?

### Get axial slice as numpy array

```
import SampleData
volumeNode = SampleData.SampleDataLogic().downloadMRHead()
sliceIndex = 12

voxels = slicer.util.arrayFromVolume(volumeNode) # Get volume as numpy array
slice = voxels[sliceIndex:,:] # Get one slice of the volume as numpy array

```

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [May 21, 2021, 10:03pm UTC](https://discourse.slicer.org/t/numpy-array-what-is-that/17727/2 "2021-05-21T22:03:24Z")

</div>

Numpy array is the de facto standard for storing n-dimensional array data in Python. You can process these arrays using functions implemented in [numpy](https://numpy.org/) and in hundreds of thousands of other Python packages.
