@@ -18,9 +18,9 @@ the ``db2`` wavelet. It's simple..
1818And the approximation and details coefficients are in ``cA `` and ``cD ``
1919respectively:
2020
21- >>> print cA
21+ >>> print (cA)
2222 [ 5.65685425 7.39923721 0.22414387 3.33677403 7.77817459]
23- >>> print cD
23+ >>> print (cD)
2424 [-2.44948974 -1.60368225 -4.44140056 -0.41361256 1.22474487]
2525
2626Inverse Discrete Wavelet Transform
@@ -29,7 +29,7 @@ Inverse Discrete Wavelet Transform
2929Now let's do an opposite operation
3030- :func: `Inverse Discrete Wavelet Transform <idwt> `:
3131
32- >>> print pywt.idwt(cA, cD, ' db2' )
32+ >>> print ( pywt.idwt(cA, cD, ' db2' ) )
3333 [ 3. 7. 1. 1. -2. 5. 4. 6.]
3434
3535Voilà! That's it!
@@ -44,9 +44,9 @@ border effect handling:
4444
4545 >>> w = pywt.Wavelet(' sym3' )
4646 >>> cA, cD = pywt.dwt(x, wavelet = w, mode = ' constant' )
47- >>> print cA
47+ >>> print (cA)
4848 [ 4.38354585 3.80302657 7.31813271 -0.58565539 4.09727044 7.81994027]
49- >>> print cD
49+ >>> print (cD)
5050 [-1.33068221 -2.78795192 -3.16825651 -0.67715519 -0.09722957 -0.07045258]
5151
5252Note that the output coefficients arrays length depends not only on the input
@@ -91,9 +91,9 @@ doing :func:`DWT <dwt>` and :func:`IDWT <idwt>`. Otherwise, it will produce
9191 >>> x
9292 [3, 7, 1, 1, -2, 5, 4, 6]
9393 >>> cA, cD = pywt.dwt(x, wavelet = w, mode = ' periodization' )
94- >>> print pywt.idwt(cA, cD, ' sym3' , ' symmetric' ) # invalid mode
94+ >>> print ( pywt.idwt(cA, cD, ' sym3' , ' symmetric' ) ) # invalid mode
9595 [ 1. 1. -2. 5.]
96- >>> print pywt.idwt(cA, cD, ' sym3' , ' periodization' )
96+ >>> print ( pywt.idwt(cA, cD, ' sym3' , ' periodization' ) )
9797 [ 3. 7. 1. 1. -2. 5. 4. 6.]
9898
9999
@@ -107,21 +107,21 @@ Now some tips & tricks. Passing ``None`` as one of the coefficient arrays
107107parameters is similar to passing a *zero-filled * array. The results are simply
108108the same:
109109
110- >>> print pywt.idwt([1 ,2 ,0 ,1 ], None , ' db2' , ' symmetric' )
110+ >>> print ( pywt.idwt([1 ,2 ,0 ,1 ], None , ' db2' , ' symmetric' ) )
111111 [ 1.19006969 1.54362308 0.44828774 -0.25881905 0.48296291 0.8365163 ]
112112
113- >>> print pywt.idwt([1 , 2 , 0 , 1 ], [0 , 0 , 0 , 0 ], ' db2' , ' symmetric' )
113+ >>> print ( pywt.idwt([1 , 2 , 0 , 1 ], [0 , 0 , 0 , 0 ], ' db2' , ' symmetric' ) )
114114 [ 1.19006969 1.54362308 0.44828774 -0.25881905 0.48296291 0.8365163 ]
115115
116- >>> print pywt.idwt(None , [1 , 2 , 0 , 1 ], ' db2' , ' symmetric' )
116+ >>> print ( pywt.idwt(None , [1 , 2 , 0 , 1 ], ' db2' , ' symmetric' ) )
117117 [ 0.57769726 -0.93125065 1.67303261 -0.96592583 -0.12940952 -0.22414387]
118118
119- >>> print pywt.idwt([0 , 0 , 0 , 0 ], [1 , 2 , 0 , 1 ], ' db2' , ' symmetric' )
119+ >>> print ( pywt.idwt([0 , 0 , 0 , 0 ], [1 , 2 , 0 , 1 ], ' db2' , ' symmetric' ) )
120120 [ 0.57769726 -0.93125065 1.67303261 -0.96592583 -0.12940952 -0.22414387]
121121
122122Remember that only one argument at a time can be ``None ``:
123123
124- >>> print pywt.idwt(None , None , ' db2' , ' symmetric' )
124+ >>> print ( pywt.idwt(None , None , ' db2' , ' symmetric' ) )
125125 Traceback (most recent call last):
126126 ...
127127 ValueError: At least one coefficient parameter must be specified.
@@ -133,7 +133,7 @@ Coefficients data size in :attr:`idwt`
133133When doing the :func: `IDWT <idwt> ` transform, usually the coefficient arrays
134134must have the same size.
135135
136- >>> print pywt.idwt([1 , 2 , 3 , 4 , 5 ], [1 , 2 , 3 , 4 ], ' db2' , ' symmetric' )
136+ >>> print ( pywt.idwt([1 , 2 , 3 , 4 , 5 ], [1 , 2 , 3 , 4 ], ' db2' , ' symmetric' ) )
137137 Traceback (most recent call last):
138138 ...
139139 ValueError: Coefficients arrays must have the same size.
0 commit comments