简体   繁体   中英

How to convert numpy distribution to an array?

I am using the function numpy.random.normal(0,0.1,20) to generate some numbers. Given below is the output I get from the function. The problem is I want these numbers to be in an array format.

[ 0.13500488 0.11023982 0.09908623 -0.01437589 0.00619559 -0.17200946 -0.00501746 0.07422642 0.1226481 -0.01422786 -0.02986386 -0.02507335 -0.12959589 -0.09346143 -0.01287027 0.02656667 -0.07538371 -0.10534301 -0.02208811 -0.14634084]

Can anyone help me?

只需在您的normal呼叫周围放置一个list(...)调用,它就会变成一个常规的Python列表。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM