Making a copy can be avoided by `.write(data.ravel().data)` I think.