数组去除第一行和第一列
代码:
import numpy as np
data = np.array(data[1:])[:, 1:].astype(float)
示例:
import numpy as np
data = np.random.randint(0,10,(5,5))
print(data)
print('*******************************')
data1 = np.array(data[1:])[:, 1:].astype(float)
print(data1)
结果: