# Unsupported numpy type when calling ds.add\_column()

**URL:** <https://discuss.huggingface.co/t/unsupported-numpy-type-when-calling-ds-add-column/24090>\
**Category:** 🤗Datasets\
**Created:** [October 6, 2022, 7:09pm UTC](https://discuss.huggingface.co/t/unsupported-numpy-type-when-calling-ds-add-column/24090 "2022-10-06T19:09:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aclifton314](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/aclifton314/32/55465_2.png) [@aclifton314](https://discuss.huggingface.co/u/aclifton314)\
**Post date:** [October 6, 2022, 7:09pm UTC](https://discuss.huggingface.co/t/unsupported-numpy-type-when-calling-ds-add-column/24090/1 "2022-10-06T19:09:19Z")

</div>

python 3.9.7  
datasets 2.5.2

I am running into an issue whenever I try to add a column to a dataset I am working with. Below is some sample code:

```python
import numpy as np

z_train = np.array(ds['train']['re_part'].numpy(), dtype=complex)
z_train.imag = ds['train']['im_part'].numpy()
ds['train'].add_column(name='complex_col', column=z_train)

```

`ds['train']['re_part']` and `ds['train']['im_part']` are initially pytorch tensors which is why I needed to convert them to numpy arrays first. I get the following error:

```python
Exception has occurred: ArrowNotImplementedError
Unsupported numpy type 15

```

and I’m not entirely sure what that is referring to. I checked the types of `z_train` and they are all numpy arrays until you get to the individual elements, in which case they are `numpy.complex128`. Any ideas? Thanks in advance for your help!

---

<div class="post-metadata">

**Author:** ![lhoestq](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/lhoestq/32/52888_2.png) [@lhoestq](https://discuss.huggingface.co/u/lhoestq)\
**Post date:** [October 7, 2022, 6:29pm UTC](https://discuss.huggingface.co/t/unsupported-numpy-type-when-calling-ds-add-column/24090/2 "2022-10-07T18:29:45Z")

</div>

Arrow doesn’t support complex numbers unfortunately.  
I think you’ll need keep storing the real and imag parts separately
