slicing 2d numpy array
Posted
by
MedicalMath
on Stack Overflow
See other posts from Stack Overflow
or by MedicalMath
Published on 2010-12-31T08:17:52Z
Indexed on
2010/12/31
8:54 UTC
Read the original article
Hit count: 263
I have a 2d numpy array called FilteredOutput that has 2 columns and 10001 rows, though the number of rows is a variable.
I am trying to take the 2nd column of FilteredOutput and use it to populate a new 1d numpy array called timeSeriesArray using the following line of code:
timeSeriesArray=p.array(FilteredOutput[:,0])
I got this syntax from the following link.
But the problem is that I am getting the following error message:
TypeError: list indices must be integers, not tuple
Can anyone show me the proper syntax for populating the 1d array timeSeriesArray with the contents of the second column of the 2d array FilteredOutput?
© Stack Overflow or respective owner