ipysheet icon indicating copy to clipboard operation
ipysheet copied to clipboard

How do you index cells in a sheet

Open awr-paul opened this issue 1 year ago • 0 comments

Unless I create every cell individually which is just too painful, I get the error.

IndexError: no cell was previously created for (row, index) = (%s, %s)

This is preventing me creating a sheet with row(), column() or cell_range(), have I missed something? For example:

from ipysheet import sheet, row, calculation

s = sheet(rows=1, columns=4)
row(0, [2, 3, 4])

@calculation(inputs=[s[0, 0], s[0, 1], s[0, 2]], output=s[0, 3])
def foo(a, b, c):
    return (a + b) / c
s

What is the correct why to index the cells within a sheet?

It would also be handy to set the value of a cell using a callable such as a lambda instead of have to define a function with the calculation decorator.

awr-paul avatar Jan 30 '23 15:01 awr-paul