@@ -1704,12 +1704,11 @@ def structured_rand_arr(size, sample_func=np.random.random,
17041704 Examples
17051705 --------
17061706 >>> np.random.seed(0) # for doctesting
1707- >>> np.set_printoptions(precision=4) # for doctesting
17081707 >>> structured_rand_arr(4)
1709- array([[ 0.5488, 0.7152, 0.6028, 0.5449],
1710- [ 0.7152, 0.6459, 0.4376, 0.8918],
1711- [ 0.6028, 0.4376, 0.7917, 0.5289],
1712- [ 0.5449, 0.8918, 0.5289, 0.0871]])
1708+ array([[0.5488, 0.7152, 0.6028, 0.5449],
1709+ [0.7152, 0.6459, 0.4376, 0.8918],
1710+ [0.6028, 0.4376, 0.7917, 0.5289],
1711+ [0.5449, 0.8918, 0.5289, 0.0871]])
17131712 >>> structured_rand_arr(4,ltfac=-10,utfac=10,fill_diag=0.5)
17141713 array([[ 0.5 , 8.3262, 7.7816, 8.7001],
17151714 [-8.3262, 0.5 , 4.6148, 7.8053],
@@ -1765,17 +1764,16 @@ def symm_rand_arr(size, sample_func=np.random.random, fill_diag=None):
17651764 Examples
17661765 --------
17671766 >>> np.random.seed(0) # for doctesting
1768- >>> np.set_printoptions(precision=4) # for doctesting
17691767 >>> symm_rand_arr(4)
1770- array([[ 0.5488, 0.7152, 0.6028, 0.5449],
1771- [ 0.7152, 0.6459, 0.4376, 0.8918],
1772- [ 0.6028, 0.4376, 0.7917, 0.5289],
1773- [ 0.5449, 0.8918, 0.5289, 0.0871]])
1768+ array([[0.5488, 0.7152, 0.6028, 0.5449],
1769+ [0.7152, 0.6459, 0.4376, 0.8918],
1770+ [0.6028, 0.4376, 0.7917, 0.5289],
1771+ [0.5449, 0.8918, 0.5289, 0.0871]])
17741772 >>> symm_rand_arr(4,fill_diag=4)
1775- array([[ 4. , 0.8326, 0.7782, 0.87 ],
1776- [ 0.8326, 4. , 0.4615, 0.7805],
1777- [ 0.7782, 0.4615, 4. , 0.9447],
1778- [ 0.87 , 0.7805, 0.9447, 4. ]])
1773+ array([[4. , 0.8326, 0.7782, 0.87 ],
1774+ [0.8326, 4. , 0.4615, 0.7805],
1775+ [0.7782, 0.4615, 4. , 0.9447],
1776+ [0.87 , 0.7805, 0.9447, 4. ]])
17791777 """
17801778 return structured_rand_arr (size , sample_func , fill_diag = fill_diag )
17811779
@@ -1797,7 +1795,6 @@ def antisymm_rand_arr(size, sample_func=np.random.random):
17971795 Examples
17981796 --------
17991797 >>> np.random.seed(0) # for doctesting
1800- >>> np.set_printoptions(precision=4) # for doctesting
18011798 >>> antisymm_rand_arr(4)
18021799 array([[ 0. , 0.7152, 0.6028, 0.5449],
18031800 [-0.7152, 0. , 0.4376, 0.8918],
@@ -1830,16 +1827,15 @@ def threshold_arr(cmat, threshold=0.0, threshold2=None):
18301827
18311828 Examples
18321829 --------
1833- >>> np.set_printoptions(precision=4) # For doctesting
18341830 >>> a = np.linspace(0,0.2,5)
18351831 >>> a
1836- array([ 0. , 0.05, 0.1 , 0.15, 0.2 ])
1832+ array([0. , 0.05, 0.1 , 0.15, 0.2 ])
18371833 >>> threshold_arr(a,0.1)
1838- (array([3, 4]), array([ 0.15, 0.2 ]))
1834+ (array([3, 4]), array([0.15, 0.2 ]))
18391835
18401836 With two thresholds:
18411837 >>> threshold_arr(a,0.1,0.2)
1842- (array([0, 1]), array([ 0. , 0.05]))
1838+ (array([0, 1]), array([0. , 0.05]))
18431839 """
18441840 # Select thresholds
18451841 if threshold2 is None :
@@ -1906,7 +1902,7 @@ def rescale_arr(arr, amin, amax):
19061902 >>> a = np.arange(5)
19071903
19081904 >>> rescale_arr(a,3,6)
1909- array([ 3. , 3.75, 4.5 , 5.25, 6. ])
1905+ array([3. , 3.75, 4.5 , 5.25, 6. ])
19101906 """
19111907
19121908 # old bounds
@@ -1941,16 +1937,15 @@ def minmax_norm(arr, mode='direct', folding_edges=None):
19411937
19421938 Examples
19431939 --------
1944- >>> np.set_printoptions(precision=4) # for doctesting
19451940 >>> a = np.linspace(0.3,0.8,4)
19461941 >>> minmax_norm(a)
1947- array([ 0. , 0.3333, 0.6667, 1. ])
1942+ array([0. , 0.3333, 0.6667, 1. ])
19481943 >>> b = np.concatenate([np.linspace(-0.7,-0.3,3),
19491944 ... np.linspace(0.3,0.8,3)])
19501945 >>> b
19511946 array([-0.7 , -0.5 , -0.3 , 0.3 , 0.55, 0.8 ])
19521947 >>> minmax_norm(b,'folding',[-0.3,0.3])
1953- array([ 0.8, 0.4, 0. , 0. , 0.5, 1. ])
1948+ array([0.8, 0.4, 0. , 0. , 0.5, 1. ])
19541949 """
19551950 if mode == 'direct' :
19561951 return rescale_arr (arr , 0 , 1 )
0 commit comments