I have an array:
[(0, b'C', 5.8816, 6.0, 0.1184, 4.2631, 4.2631, 0.0)
(1, b'H', 0.8495, 1.0, 0.1505, 0.951, 0.951, 0.0)
(2, b'Br', 35.0064, 35.0, -0.0064, 1.2192, 1.2192, -0.0)
(3, b'Cl', 17.0401, 17.0, -0.0401, 1.2405, 1.2405, -0.0)
(4, b'F', 9.2225, 9.0, -0.2225, 1.0449, 1.0449, -0.0)]
from which I want to extract single columns of floating point numbers fro use further on in the program.
When I try the following:
QA = []
idx_IN_columns = [5]
QA = data[idx_IN_columns]
I get:
Traceback (most recent call last):
File "<ipython-input-22-4e6a1b6a3f36>", line 1, in <module>
runfile('C:/Users/Steve/Python/Testing/ReadFile_mpa_1.py', wdir='C:/Users/Steve/Python/Testing')
File "C:\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 866, in runfile
execfile(filename, namespace)
File "C:\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
enter code here
File "C:/Users/Steve/Python/Testing/ReadFile_mpa_1.py", line 34, in <module>
QA = data[idx_IN_columns]
IndexError: index 5 is out of bounds for axis 1 with size 5
Assistance will be much appreciated.
Thanks in advance