numpy小数转换成整数

astype的返回值才是整数!!!

a = abs(np.random.normal(0, 2, size=30))
a = a.astype(int)

!!!

posted @ 2022-04-09 15:05  bH1pJ  阅读(119)  评论(0编辑  收藏  举报