ipysheet
ipysheet copied to clipboard
to_array() does not return cell value changed by clicking inside table
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)
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!
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)