Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,862 questions

51,784 answers

573 users

How to generate 3D array of with random floats between 0.0 to 1.0 in Python

1 Answer

0 votes
import numpy as geek 
   
arr = geek.random.ranf((3, 4, 2)) 
 
print(arr)  
 
  
  
'''
run:
  
[[[0.28801685 0.94468601]
  [0.68352114 0.46565935]
  [0.14614204 0.17202777]
  [0.09224978 0.33544346]]

 [[0.39899207 0.23529823]
  [0.06155382 0.17637916]
  [0.49291294 0.75698178]
  [0.1177161  0.49895115]]

 [[0.93548753 0.94647507]
  [0.65470648 0.60517196]
  [0.10902152 0.45896501]
  [0.21067136 0.02140086]]]
  
'''

 



answered Feb 17, 2020 by avibootz
...