functions to save dataset as npy files