Here's a MWE
of my code:
import numpy as np
# Load data from file.
data = np.genfromtxt('data_input', dtype=None, unpack=True)
print data
Here's a sample of the data_input
file:
01_500_aa_1000 990.0 990.0 112.5 0.2 72 0 0 1 0 0 0 0 0 0 0 0 0 1
02_500_aa_0950 990.0 990.0 112.5 0.2 77 0 0 1 0 0 0 0 0 0 0 0 0 1
03_500_aa_0600 990.0 990.0 112.5 0.18 84 0 0 1 0 0 0 0 0 0 0 0 0 1
04_500_aa_0700 990.0 990.0 112.5 0.18 84 0 0 1 0 0 0 0 0 0 0 0 0 1
The unpack
argument does not appear to work since it always prints:
[ ('01_500_aa_1000', 990.0, 990.0, 112.5, 0.2, 72, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1)
('02_500_aa_0950', 990.0, 990.0, 112.5, 0.2, 77, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1)
('03_500_aa_0600', 990.0, 990.0, 112.5, 0.18, 84, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1)
('04_500_aa_0700', 990.0, 990.0, 112.5, 0.18, 84, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1)]
Can anybody reproduce this? What am I doing wrong?