使用numpy随机函数时出错,它显示int对象不可调用,请建议替代方法
发布于 2020-06-24 15:35:12
您在向np.random.random_integers传递参数时遗漏了第二个逗号(此处:(100(3,4))),因此它假设100是您向其传递参数3和4的函数,但事实并非如此,因为100是一个整数。
变化
np.random.random_integers(50, 100(3,4))至
np.random.random_integers(50, 100, (3, 4))发布于 2020-06-24 15:34:11
xx=np.random.random_integers(50,100(3,4))
请推荐替代方案
作为替代方案,我建议插入缺少的逗号:
xx = np.random.random_integers(50, 100, (3, 4))https://stackoverflow.com/questions/62549551
复制相似问题