Horje
python how to copy a 2d array leaving out last column Code Example
python how to copy a 2d array leaving out last column
In [1]: import numpy as np

In [2]: H = np.meshgrid(np.arange(5), np.arange(5))[0]

In [3]: H
Out[3]: 
array([[0, 1, 2, 3, 4],
       [0, 1, 2, 3, 4],
       [0, 1, 2, 3, 4],
       [0, 1, 2, 3, 4],
       [0, 1, 2, 3, 4]])

In [4]: Hsub = H[1:-1,1:-1]

In [5]: Hsub
Out[5]: 
array([[1, 2, 3],
       [1, 2, 3],
       [1, 2, 3]])




Python

Related
plot python x axis range Code Example plot python x axis range Code Example
how to get location of word in list in python Code Example how to get location of word in list in python Code Example
read csv uisng pandas Code Example read csv uisng pandas Code Example
case statement in pandas Code Example case statement in pandas Code Example
python selenium clear input Code Example python selenium clear input Code Example

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