Horje
Return array of odd rows and even columns from array using numpy Code Example
Return array of odd rows and even columns from array using numpy
import numpy

sampleArray = numpy.array([[3 ,6, 9, 12], [15 ,18, 21, 24], 
[27 ,30, 33, 36], [39 ,42, 45, 48], [51 ,54, 57, 60]]) 
print("Printing Input Array")
print(sampleArray)

print("\n Printing array of odd rows and even columns")
newArray = sampleArray[::2, 1::2]
print(newArray)
Source: pynative.com




Python

Related
legend matplotlib twinx Code Example legend matplotlib twinx Code Example
add variable to print python Code Example add variable to print python Code Example
python union type Code Example python union type Code Example
Qt convert image to base64 Code Example Qt convert image to base64 Code Example
tensorboard 2.1.0 has requirement grpcio>=1.24.3, but you'll have grpcio 1.15.0 which is incompatible Code Example tensorboard 2.1.0 has requirement grpcio>=1.24.3, but you'll have grpcio 1.15.0 which is incompatible Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10