As it was not mentioned clearly enough (and i was looking for it too):
an equivalent to:
a = my_array[:, :, :, 8]
b = my_array[:, :, :, 2:7]
is:
a = my_array.take(indices=8, axis=3)
b = my_array.take(indices=range(2, 7), axis=3)
More Related Contents:
- Python: Justifying NumPy array
- Numpy where function multiple conditions
- testing whether a Numpy array contains a given row
- Limit number of threads in numpy
- python numpy ValueError: operands could not be broadcast together with shapes
- Dropping infinite values from dataframes in pandas?
- How can I add new dimensions to a Numpy array?
- Find matching rows in 2 dimensional numpy array
- itertools product speed up
- Pandas lookup from one of multiple columns, based on value
- Passing Numpy arrays to a C function for input and output
- Check if two 3D numpy arrays contain overlapping 2D arrays
- Get year, month or day from numpy datetime64
- more efficient way to calculate distance in numpy?
- Get coordinates of local maxima in 2D array above certain value
- How to get element-wise matrix multiplication (Hadamard product) in numpy?
- 2D array indexing
- How to get the indices list of all NaN value in numpy array?
- Equivalent of `polyfit` for a 2D polynomial in Python
- Combine 3 separate numpy arrays to an RGB image in Python
- Numpy Vector (N,1) dimension -> (N,) dimension conversion
- Custom data types in numpy arrays
- Python’s and Numpy’s nan and set
- Numpy shuffle multidimensional array by row only, keep column order unchanged
- Converting 2D Numpy array of grayscale values to a PIL image
- Numpy array broadcasting rules
- Convert a column of timestamps into periods in pandas
- Elegant way to perform tuple arithmetic
- Why can’t I raise to a negative power in numpy?
- Generate random array of floats between a range