<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def separable_approx(h, N=1):
 """ finds the k-th rank approximation to h, where k = 1..N similar to separable_series Parameters h: ndarray input array (2 or 2 dimensional) N: int order of approximation Returns ------- all N apprxoimations res[i], the i-th approximation """

    if h.ndim == 2:
        return _separable_approx2(h, N)
    elif h.ndim == 3:
        return _separable_approx3(h, N)
    else:
        raise ValueError("unsupported array dimension: %s (only 2d or 3d) " % h.ndim)