import numpy as np import math def x1_4(ProblemIndex): step = 3 # 步长 y = [] i, c = 0, 0 number = 1000 # 个数 while (True): if (c == number): break else: y.append(i) i += step c += 1 y = np.array(y) xyMap = np.random.rand(1000, 2) if (ProblemIndex == 1): for i in range(len(y)): xyMap[i][0] = y[i] xyMap[i][1] = 2 * y[i] + 1 return xyMap elif (ProblemIndex == 2): for i in range(len(y)): xyMap[i][0] = y[i] xyMap[i][1] = y[i] / 3 return xyMap if __name__ == '__main__': print(x1_4(1))