Linked Questions

Popular Questions

I am reading a tutorial for numpy, and it's creating an array using 'b' as below. Why doesn't it use 'a'? I tested and it seems both 'a' and 'b' have the same effect. Is that right?

 In [39]: a = np.random.normal(0, 1.5, (10))                                                                                                                   

In [40]: b = np.random.normal(0, 1.5, (10,))                                                                                                                  

In [41]: a.shape                                                                                                                                              
Out[41]: (10,)

In [42]: b.shape                                                                                                                                              
Out[42]: (10,)

In [43]: a                                                                                                                                                    
Out[43]: 
array([-0.10626252,  0.54973224, -0.9940606 ,  2.96486485, -2.41171607,
        3.59483954,  1.19982736,  0.66358172,  0.93966334, -0.99427335])

In [44]: b                                                                                                                                                    
Out[44]: 
array([-1.39136937,  0.38089925, -1.25003939,  3.27460748, -3.10624895,
       -1.27641556, -2.06235267, -0.50606768,  0.21605496, -0.4252462 ])

Related Questions