Template
Finished Homework2.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
'''
|
||||
Author: SJ2050
|
||||
Date: 2021-10-29 19:23:02
|
||||
LastEditTime: 2021-10-29 22:45:38
|
||||
Version: v0.0.1
|
||||
Description: Solution for homework1_6.
|
||||
Copyright © 2021 SJ2050
|
||||
'''
|
||||
import numpy as np
|
||||
|
||||
if __name__ == '__main__':
|
||||
random_mat = np.random.rand(10, 10)
|
||||
max_one = np.max(random_mat)
|
||||
min_one = np.min(random_mat)
|
||||
|
||||
print('随机产生的矩阵如下:\n', random_mat)
|
||||
print(f'最大值元素为: {max_one}, 最小值元素为: {min_one}')
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 108 KiB |
@@ -0,0 +1,11 @@
|
||||
# 1.6 寻找10x10数组最大值
|
||||
|
||||
## (1). 解题思路
|
||||
|
||||
`10x10`的数组可以通过你`numpy.random.rand`函数通过给定`10x10`的维度生成,然后直接调用内置方法`max`与`min`可以找到数组中的最大最小值。
|
||||
|
||||
|
||||
|
||||
## (2). 运行结果
|
||||
|
||||

|
||||
Reference in New Issue
Block a user