How to use the ipysheet.Cell 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 / test_all.py View on Github external
def test_cell_values():
    cell = ipysheet.cell(0, 0, value=True)
    assert cell.value is True
    assert cell.type == 'checkbox'

    cell = ipysheet.cell(0, 0, value=1.2)
    assert cell.value == 1.2
    assert cell.type == 'numeric'
    cell = ipysheet.cell(0, 0, value=1)
    assert cell.value == 1
    assert cell.type == 'numeric'

    cell = ipysheet.Cell(value='1.2')
    assert cell.value == '1.2'
    assert cell.type is None

    cell = ipysheet.row(0, [True, False])
    assert cell.value == [True, False]
    assert cell.type == 'checkbox'

    cell = ipysheet.row(0, [0, 1.2])
    assert cell.value == [0, 1.2]
    assert cell.type == 'numeric'

    cell = ipysheet.row(0, [0, 1])
    assert cell.value == [0, 1]
    assert cell.type == 'numeric'

    cell = ipysheet.row(0, ['a', 'b'])