diff options
Diffstat (limited to 'lib/utils/string.py')
| -rw-r--r-- | lib/utils/string.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/utils/string.py b/lib/utils/string.py new file mode 100644 index 00000000..a7839f7d --- /dev/null +++ b/lib/utils/string.py @@ -0,0 +1,5 @@ +def string_to_floats(string, delimiter=","): + """Convert a string of delimiter-separated floats into a list of floats.""" + + floats = string.split(delimiter) + return [float(num) for num in floats] |
