def getArrayDimensions(shape):
    """
    Get the dimensions of the grid where the cell will be zoomed.

    The zoomed cell contains a `numpy` array and will be displayed
    in a table with the same shape than it.

    :Parameter shape: the cell shape

    :Returns: a tuple (rows, columns)
    """

    # Numpy scalars are special a case
    if shape == ():
        nrows = ncols = 1
    # 1-D arrays are displayed as a 1-column vector with nrows
    elif len(shape) == 1:
        nrows = shape[0]
        ncols = 1
    # N-D arrays are displayed as a matrix (nrowsXncols) which
    # elements are (N-2)-D arrays
    else:
        nrows = shape[0]
        ncols = shape[1]

    return (nrows, ncols)