I have a problem using the function numpy.append.
I wrote the following function as part of a larger piece of code,
however, my error is reproduced in the folowing:
data = [
[
'3.5', '3', '0', '0', '15', '6',
'441', 'some text', 'some more complicated data'
],
[
'4.5', '5', '1', '10', '165', '0',
'1', 'some other text', 'some even more complicated data'
]
]
def GetNumpyArrey(self, index):
r = np.array([])
for line in data:
np.append(r, float(line[index]))
print r
index < 6.
the result is:
>> []
what am I doing wrong?
Thanks a lot !
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…