I am trying to pass a column of numbers to a Python script to then convert into a numpy array.
input.txt
42
42.4
43.5153
44
Bash Code
python script.py ${input}
Python Script
#!/usr/bin/env python3
import sys
import numpy
in = sys.argv[1]
in_out = np.array([float(in)])
print "Inputs:" in_out
sys.exit()
Python Error
Traceback (most recent call last):
File "script.py", line 8, in <module>
in_out = np.array([float(in)])
ValueError: invalid literal for float(): 42
in_inand${input}? I presume you need to read the file instead of reading and parsing the filename as a float