def METHOD_NAME(self, f):
    npdata = self.dat.data_ro.reshape(-1)
    npdatacopy = npdata.copy()
    for i in range(len(npdata)):
        npdatacopy[i] = f(npdata[i])
    self.assign(self._constant_from_values(npdatacopy))