Commit d7a7ebe0 authored by Martin Schrön's avatar Martin Schrön
Browse files

Fixed xsplit function to allow spaces in items

parent 969585ad
......@@ -291,9 +291,10 @@ def xsplit(s, range=0, type=str):
optionally generate an array of length `range`.
E.g.: coords = xplit('51.5, 12.1, 120', range=3, type=float)
if isinstance(s, str):
s = s.replace(',',' ')
a = np.array(s.split(), dtype=type)
if isinstance(s, str) and s.strip() != '':
#s = s.replace(',',' ')
#a = np.array(s.split(), dtype=type)
a = np.array([x.strip() for x in s.split(',')], dtype=type)
a = np.array([])
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