'Apply a function to each element of the N-dim array.
Examples
>>> from sympy import ImmutableDenseNDimArray
>>> m = ImmutableDenseNDimArray([i*2+j for i in range(2) for j in range(2)], (2, 2))
>>> m
[[0, 1], [2, 3]]
>>> m.applyfunc(lambda i: 2*i)
[[0, 2], [4, 6]]'

def applyfunc(self, f):

    return type(self)(map(f, self), self.shape)
