Commit 8c373fae authored by Alexander Marchuk's avatar Alexander Marchuk
Browse files

fix slicing for 1d

parent 6db4766e
Showing with 5 additions and 4 deletions
+5 -4
...@@ -399,16 +399,17 @@ def array_to_xml(array, roffset, coffset, rows, cols, format): ...@@ -399,16 +399,17 @@ def array_to_xml(array, roffset, coffset, rows, cols, format):
cols = 1 cols = 1
elif rows == 1 or cols == 1: elif rows == 1 or cols == 1:
is_row = True if (rows == 1) else False is_row = True if (rows == 1) else False
pure_1d = False if (len(array) == 1) else True if is_row:
array = array[roffset:]
else:
array = array[coffset:]
if not pure_1d: if len(array) == 1:
array = array[0] array = array[0]
if is_row: if is_row:
array = array[coffset:]
cols = min(cols, len(array)) cols = min(cols, len(array))
else: else:
array = array[roffset:]
rows = min(rows, len(array)) rows = min(rows, len(array))
else: else:
array = array[roffset:, coffset:] array = array[roffset:, coffset:]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment