How about this ...

```
    if isinstance(array.dtype, np.float):
        data = array.copy()
    else:
        data = array.astype('float32')
```