程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Python data analysis and processing

編輯:Python

 

 

1、numpy.random.rand(d0, d1, ..., dn)

effect : Generate an array of given shapes ( In fact, it should be ndarray Object or a single value ), The values in the array obey [0, 1) Between Uniform distribution .
Parameters :d0, d, ..., dn : int, Optional . If there is no parameter, it returns a float Random number of type , The random number obeys [0, 1) A uniform distribution between .
Return value :ndarray Object or a float The value of the type

# [0, 1) A random number evenly distributed between ,3 That's ok 2 Column
a = np.random.rand(3, 2)
print(a)
# No shapes provided
b = np.random.rand()
print(b)

 

[[0.26054323 0.28184468]
[0.7783674 0.71733674]
[0.90302256 0.49303252]]
0.6022098740124009

 


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved