How to use the ipysheet.easy.cell_range function in ipysheet

To help you get started, we’ve selected a few ipysheet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github QuantStack / ipysheet / ipysheet / numpy_loader.py View on Github external
if len(array.shape) > 2:
        raise RuntimeError('The NumPy Array should be of 1-D or 2-D')

    rows = array.shape[0]
    columns = 1 if len(array.shape) == 1 else array.shape[1]

    kwargs = {
        'numeric_format': get_cell_numeric_format(array.dtype),
        'type': get_cell_type(array.dtype)
    }

    out_sheet = sheet(rows=rows, columns=columns)
    if columns == 1:
        column(0, array, **kwargs)
    else:
        cell_range(array, **kwargs)
    return out_sheet