ipysheet icon indicating copy to clipboard operation
ipysheet copied to clipboard

to_array() does not return cell value changed by clicking inside table

Open kragens opened this issue 3 years ago • 2 comments

scenario:

  • type in jupyter lab (3.0.0): from ipysheet import sheet, to_array sh = ipysheet.sheet(rows=1) sh
  • edit this table by clicking inside the first cell and type a string (e.g. 'Hello')
  • print numpy array to_array(sh)

problem: to_array(sh) returns array([[None, None, None, None, None]], dtype=object)

expected: to_array(sh) returns array([['Hello', None, None, None, None]], dtype=object)

kragens avatar Apr 02 '21 16:04 kragens

I just ran into to same issue. Both to_dataframe() and to_array() do not work properly for capturing values manually entered into the cells. It took me several hours to figure this out. Sigh!

giswqs avatar Jan 27 '22 14:01 giswqs

Here is a workaround

import ipysheet
rows = 3
columns = 2
sheet = ipysheet.sheet(rows=rows, columns=columns)
for i in range(columns):
    ipysheet.column(i, [""] * sheet.rows)
sheet

# ipysheet.to_dataframe(sheet)
# ipysheet.to_array(sheet)

giswqs avatar Jan 27 '22 16:01 giswqs