Message308124
Python lists don't implement extended slices, try numpy arrays:
>>> import numpy as np
>>> x = array([[1,2,3], [4,5,6]])
>>> x[:, 2]
array([3, 6])
>>>
>>> lst = [[1,2,3], [4,5,6]]
>>> lst[:, 2]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: list indices must be integers or slices, not tuple
>>>
Was there any issue apart from the extended slices? |
|
Date |
User |
Action |
Args |
2017-12-12 12:46:19 | skrah | set | recipients:
+ skrah, steven.daprano, docs@python, Massimiliano Culpo |
2017-12-12 12:46:19 | skrah | set | messageid: <1513082779.44.0.213398074469.issue32288@psf.upfronthosting.co.za> |
2017-12-12 12:46:19 | skrah | link | issue32288 messages |
2017-12-12 12:46:19 | skrah | create | |
|