This works great. ``` In [11]: arr = nd.array([1.5,2,3],dtype='?float64') In [12]: arr Out[12]: nd.array([1.5, 2, 3], type="3 * ?float64") In [13]: nd.view(arr,ndt.type('3 * float64')) Out[13]: nd.array([1.5, 2, 3], type="3 * float64") ``` however, say I want to cast to `float32`. I need to compose `3 * float32`). Is their a way in `ndt` to do this generally? It can be done by string substituteion with this, but not that elegant ``` In [16]: nd.dshape_of(arr) Out[16]: '3 * ?float64' ```
Activity
mwiebe commentedon Sep 21, 2015
One idea is to add a search/replace pattern matching method on the ndt.type. Like
tp.replace("Scalar", "float32")to substitute the dtype.