function made to replace all contents of ndarray to a specified value