No need to do this cast to string you can just check if the type is an N-dimensional array:

```python
In [5]: from numpy import ndarray, array

In [6]: q = array([1, 2, 3, 4])

In [7]: type(q) == ndarray
Out[7]: True
```