Skip to content

Commit 2fa5ce0

Browse files
committed
ENH: None -> '' in Sheet adapter
1 parent 73c6ee3 commit 2fa5ce0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

larray_editor/arrayadapter.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1687,6 +1687,9 @@ def close(self):
16871687
self.data.close()
16881688

16891689

1690+
none_to_empty_string = np.vectorize(lambda v: v if v is not None else '')
1691+
1692+
16901693
@adapter_for('larray.inout.xw_excel.Sheet')
16911694
class SheetAdapter(AbstractAdapter):
16921695
def shape2d(self):
@@ -1707,7 +1710,7 @@ def get_values(self, h_start, v_start, h_stop, v_stop):
17071710
# ranges)
17081711
if np_data.ndim < 2:
17091712
np_data = np_data.reshape((v_stop - v_start, h_stop - h_start))
1710-
return np_data
1713+
return none_to_empty_string(np_data)
17111714

17121715

17131716
@adapter_for('larray.inout.xw_excel.Range')

0 commit comments

Comments
 (0)