---
# System prepended metadata

title: Numpy magic
tags: [numpy, ' python']

---

---
tags: numpy, python
title: Numpy magic
---

# Numpy magic

## saving masked arrays

```python
import numpy as np

# Saving masked array 'arr':
np.savez_compressed('test.npz', data=arr.data, mask=arr.mask)

# Loading array back
with np.load('test.npz') as npz:
    arr = np.ma.MaskedArray(**npz)
    
```