summaryrefslogtreecommitdiff
path: root/numpy/oldnumeric
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/oldnumeric')
-rw-r--r--numpy/oldnumeric/__init__.py2
-rw-r--r--numpy/oldnumeric/alter_code1.py2
-rw-r--r--numpy/oldnumeric/alter_code2.py2
-rw-r--r--numpy/oldnumeric/array_printer.py2
-rw-r--r--numpy/oldnumeric/arrayfns.py2
-rw-r--r--numpy/oldnumeric/compat.py2
-rw-r--r--numpy/oldnumeric/fft.py2
-rw-r--r--numpy/oldnumeric/fix_default_axis.py4
-rw-r--r--numpy/oldnumeric/functions.py2
-rw-r--r--numpy/oldnumeric/linear_algebra.py2
-rw-r--r--numpy/oldnumeric/ma.py2
-rw-r--r--numpy/oldnumeric/matrix.py2
-rw-r--r--numpy/oldnumeric/misc.py2
-rw-r--r--numpy/oldnumeric/mlab.py2
-rw-r--r--numpy/oldnumeric/precision.py2
-rw-r--r--numpy/oldnumeric/random_array.py56
-rw-r--r--numpy/oldnumeric/rng.py2
-rw-r--r--numpy/oldnumeric/rng_stats.py2
-rw-r--r--numpy/oldnumeric/setup.py2
-rw-r--r--numpy/oldnumeric/tests/test_oldnumeric.py2
-rw-r--r--numpy/oldnumeric/tests/test_regression.py2
-rw-r--r--numpy/oldnumeric/typeconv.py2
-rw-r--r--numpy/oldnumeric/ufuncs.py2
-rw-r--r--numpy/oldnumeric/user_array.py2
24 files changed, 52 insertions, 52 deletions
diff --git a/numpy/oldnumeric/__init__.py b/numpy/oldnumeric/__init__.py
index ff8c00885..cf34b8300 100644
--- a/numpy/oldnumeric/__init__.py
+++ b/numpy/oldnumeric/__init__.py
@@ -1,7 +1,7 @@
"""Don't add these to the __all__ variable though
"""
-from __future__ import division, absolute_import
+from __future__ import division, absolute_import, print_function
from numpy import *
diff --git a/numpy/oldnumeric/alter_code1.py b/numpy/oldnumeric/alter_code1.py
index f970994e4..1e84fd894 100644
--- a/numpy/oldnumeric/alter_code1.py
+++ b/numpy/oldnumeric/alter_code1.py
@@ -29,7 +29,7 @@ Makes the following changes:
isinstance(..., <type>)
"""
-from __future__ import division, absolute_import
+from __future__ import division, absolute_import, print_function
__all__ = ['convertfile', 'convertall', 'converttree', 'convertsrc']
diff --git a/numpy/oldnumeric/alter_code2.py b/numpy/oldnumeric/alter_code2.py
index 6d33efd60..4e4d94cd6 100644
--- a/numpy/oldnumeric/alter_code2.py
+++ b/numpy/oldnumeric/alter_code2.py
@@ -19,7 +19,7 @@ Makes the following changes:
oldnumeric.random_array, and oldnumeric.fft
"""
-from __future__ import division, absolute_import
+from __future__ import division, absolute_import, print_function
#__all__ = ['convertfile', 'convertall', 'converttree']
__all__ = []
diff --git a/numpy/oldnumeric/array_printer.py b/numpy/oldnumeric/array_printer.py
index f14872821..9cccc5023 100644
--- a/numpy/oldnumeric/array_printer.py
+++ b/numpy/oldnumeric/array_printer.py
@@ -1,4 +1,4 @@
-from __future__ import division, absolute_import
+from __future__ import division, absolute_import, print_function
__all__ = ['array2string']
diff --git a/numpy/oldnumeric/arrayfns.py b/numpy/oldnumeric/arrayfns.py
index 03f816db8..534ccacf7 100644
--- a/numpy/oldnumeric/arrayfns.py
+++ b/numpy/oldnumeric/arrayfns.py
@@ -1,7 +1,7 @@
"""Backward compatible with arrayfns from Numeric.
"""
-from __future__ import division, absolute_import
+from __future__ import division, absolute_import, print_function
__all__ = ['array_set', 'construct3', 'digitize', 'error', 'find_mask',
'histogram', 'index_sort', 'interp', 'nz', 'reverse', 'span',
diff --git a/numpy/oldnumeric/compat.py b/numpy/oldnumeric/compat.py
index b63226571..841052656 100644
--- a/numpy/oldnumeric/compat.py
+++ b/numpy/oldnumeric/compat.py
@@ -1,7 +1,7 @@
"""Compatibility module containing deprecated names.
"""
-from __future__ import division, absolute_import
+from __future__ import division, absolute_import, print_function
import sys
import copy
diff --git a/numpy/oldnumeric/fft.py b/numpy/oldnumeric/fft.py
index 7ea554e4a..0fd3ae48e 100644
--- a/numpy/oldnumeric/fft.py
+++ b/numpy/oldnumeric/fft.py
@@ -1,4 +1,4 @@
-from __future__ import division, absolute_import
+from __future__ import division, absolute_import, print_function
__all__ = ['fft', 'fft2d', 'fftnd', 'hermite_fft', 'inverse_fft',
'inverse_fft2d', 'inverse_fftnd',
diff --git a/numpy/oldnumeric/fix_default_axis.py b/numpy/oldnumeric/fix_default_axis.py
index cefa67239..57ab3ce78 100644
--- a/numpy/oldnumeric/fix_default_axis.py
+++ b/numpy/oldnumeric/fix_default_axis.py
@@ -34,7 +34,7 @@ std
mean
"""
-from __future__ import division, absolute_import
+from __future__ import division, absolute_import, print_function
__all__ = ['convertfile', 'convertall', 'converttree']
@@ -261,7 +261,7 @@ def convertfile(filename, import_change=False):
filestr = getfile(filename)
newstr, total = add_axis(filestr, import_change)
if total > 0:
- print "Changing ", filename
+ print("Changing ", filename)
copyfile(filename, filestr)
makenewfile(filename, newstr)
sys.stdout.flush()
diff --git a/numpy/oldnumeric/functions.py b/numpy/oldnumeric/functions.py
index 50c11e32c..c5941fb67 100644
--- a/numpy/oldnumeric/functions.py
+++ b/numpy/oldnumeric/functions.py
@@ -1,7 +1,7 @@
"""Functions that should behave the same as Numeric and need changing
"""
-from __future__ import division, absolute_import
+from __future__ import division, absolute_import, print_function
import numpy as np
import numpy.core.multiarray as mu
diff --git a/numpy/oldnumeric/linear_algebra.py b/numpy/oldnumeric/linear_algebra.py
index e850cd792..f9938b503 100644
--- a/numpy/oldnumeric/linear_algebra.py
+++ b/numpy/oldnumeric/linear_algebra.py
@@ -6,7 +6,7 @@ only accesses the following LAPACK functions: dgesv, zgesv, dgeev,
zgeev, dgesdd, zgesdd, dgelsd, zgelsd, dsyevd, zheevd, dgetrf, dpotrf.
"""
-from __future__ import division, absolute_import
+from __future__ import division, absolute_import, print_function
__all__ = ['LinAlgError', 'solve_linear_equations',
'inverse', 'cholesky_decomposition', 'eigenvalues',
diff --git a/numpy/oldnumeric/ma.py b/numpy/oldnumeric/ma.py
index b449d619c..31e2bb64d 100644
--- a/numpy/oldnumeric/ma.py
+++ b/numpy/oldnumeric/ma.py
@@ -9,7 +9,7 @@ Adapted for numpy_core 2005 by Travis Oliphant and
(mainly) Paul Dubois.
"""
-from __future__ import division, absolute_import
+from __future__ import division, absolute_import, print_function
import types, sys
diff --git a/numpy/oldnumeric/matrix.py b/numpy/oldnumeric/matrix.py
index e76f8935f..4d04090b8 100644
--- a/numpy/oldnumeric/matrix.py
+++ b/numpy/oldnumeric/matrix.py
@@ -1,7 +1,7 @@
"""This module is for compatibility only.
"""
-from __future__ import division, absolute_import
+from __future__ import division, absolute_import, print_function
__all__ = ['UserArray', 'squeeze', 'Matrix', 'asarray', 'dot', 'k', 'Numeric', 'LinearAlgebra', 'identity', 'multiply', 'types', 'string']
diff --git a/numpy/oldnumeric/misc.py b/numpy/oldnumeric/misc.py
index 5ef1f0ac9..beaafd503 100644
--- a/numpy/oldnumeric/misc.py
+++ b/numpy/oldnumeric/misc.py
@@ -1,7 +1,7 @@
"""Functions that already have the correct syntax or miscellaneous functions
"""
-from __future__ import division, absolute_import
+from __future__ import division, absolute_import, print_function
__all__ = ['sort', 'copy_reg', 'clip', 'rank',
'sign', 'shape', 'types', 'allclose', 'size',
diff --git a/numpy/oldnumeric/mlab.py b/numpy/oldnumeric/mlab.py
index d4063f65e..bc2844a87 100644
--- a/numpy/oldnumeric/mlab.py
+++ b/numpy/oldnumeric/mlab.py
@@ -1,7 +1,7 @@
"""This module is for compatibility only. All functions are defined elsewhere.
"""
-from __future__ import division, absolute_import
+from __future__ import division, absolute_import, print_function
__all__ = ['rand', 'tril', 'trapz', 'hanning', 'rot90', 'triu', 'diff', 'angle',
'roots', 'ptp', 'kaiser', 'randn', 'cumprod', 'diag', 'msort',
diff --git a/numpy/oldnumeric/precision.py b/numpy/oldnumeric/precision.py
index 7c85f21fc..d7b0344ee 100644
--- a/numpy/oldnumeric/precision.py
+++ b/numpy/oldnumeric/precision.py
@@ -6,7 +6,7 @@ The character strings are still for "new" NumPy
which is the only Incompatibility with Numeric
"""
-from __future__ import division, absolute_import
+from __future__ import division, absolute_import, print_function
__all__ = ['Character', 'Complex', 'Float',
'PrecisionError', 'PyObject', 'Int', 'UInt',
diff --git a/numpy/oldnumeric/random_array.py b/numpy/oldnumeric/random_array.py
index 4dcddda12..ecb3d0b23 100644
--- a/numpy/oldnumeric/random_array.py
+++ b/numpy/oldnumeric/random_array.py
@@ -1,7 +1,7 @@
"""Backward compatible module for RandomArray
"""
-from __future__ import division, absolute_import
+from __future__ import division, absolute_import, print_function
__all__ = ['ArgumentError','F','beta','binomial','chi_square', 'exponential',
'gamma', 'get_seed', 'mean_var_test', 'multinomial',
@@ -192,12 +192,12 @@ def mean_var_test(x, type, mean, var, skew=[]):
x_mean = np.sum(x,axis=0)/n
x_minus_mean = x - x_mean
x_var = np.sum(x_minus_mean*x_minus_mean,axis=0)/(n-1.0)
- print "\nAverage of ", len(x), type
- print "(should be about ", mean, "):", x_mean
- print "Variance of those random numbers (should be about ", var, "):", x_var
+ print("\nAverage of ", len(x), type)
+ print("(should be about ", mean, "):", x_mean)
+ print("Variance of those random numbers (should be about ", var, "):", x_var)
if skew != []:
x_skew = (np.sum(x_minus_mean*x_minus_mean*x_minus_mean,axis=0)/9998.)/x_var**(3./2.)
- print "Skewness of those random numbers (should be about ", skew, "):", x_skew
+ print("Skewness of those random numbers (should be about ", skew, "):", x_skew)
def test():
obj = mt.get_state()
@@ -205,25 +205,25 @@ def test():
obj2 = mt.get_state()
if (obj2[1] - obj[1]).any():
raise SystemExit("Failed seed test.")
- print "First random number is", random()
- print "Average of 10000 random numbers is", np.sum(random(10000),axis=0)/10000.
+ print("First random number is", random())
+ print("Average of 10000 random numbers is", np.sum(random(10000),axis=0)/10000.)
x = random([10,1000])
if len(x.shape) != 2 or x.shape[0] != 10 or x.shape[1] != 1000:
raise SystemExit("random returned wrong shape")
x.shape = (10000,)
- print "Average of 100 by 100 random numbers is", np.sum(x,axis=0)/10000.
+ print("Average of 100 by 100 random numbers is", np.sum(x,axis=0)/10000.)
y = uniform(0.5,0.6, (1000,10))
if len(y.shape) !=2 or y.shape[0] != 1000 or y.shape[1] != 10:
raise SystemExit("uniform returned wrong shape")
y.shape = (10000,)
if np.minimum.reduce(y) <= 0.5 or np.maximum.reduce(y) >= 0.6:
raise SystemExit("uniform returned out of desired range")
- print "randint(1, 10, shape=[50])"
- print randint(1, 10, shape=[50])
- print "permutation(10)", permutation(10)
- print "randint(3,9)", randint(3,9)
- print "random_integers(10, shape=[20])"
- print random_integers(10, shape=[20])
+ print("randint(1, 10, shape=[50])")
+ print(randint(1, 10, shape=[50]))
+ print("permutation(10)", permutation(10))
+ print("randint(3,9)", randint(3,9))
+ print("random_integers(10, shape=[20])")
+ print(random_integers(10, shape=[20]))
s = 3.0
x = normal(2.0, s, [10, 1000])
if len(x.shape) != 2 or x.shape[0] != 10 or x.shape[1] != 1000:
@@ -233,19 +233,19 @@ def test():
x = exponential(3, 10000)
mean_var_test(x, "random numbers exponentially distributed with mean %f"%(s,), s, s**2, 2)
x = multivariate_normal(np.array([10,20]), np.array(([1,2],[2,4])))
- print "\nA multivariate normal", x
+ print("\nA multivariate normal", x)
if x.shape != (2,): raise SystemExit("multivariate_normal returned wrong shape")
x = multivariate_normal(np.array([10,20]), np.array([[1,2],[2,4]]), [4,3])
- print "A 4x3x2 array containing multivariate normals"
- print x
+ print("A 4x3x2 array containing multivariate normals")
+ print(x)
if x.shape != (4,3,2): raise SystemExit("multivariate_normal returned wrong shape")
x = multivariate_normal(np.array([-100,0,100]), np.array([[3,2,1],[2,2,1],[1,1,1]]), 10000)
x_mean = np.sum(x,axis=0)/10000.
- print "Average of 10000 multivariate normals with mean [-100,0,100]"
- print x_mean
+ print("Average of 10000 multivariate normals with mean [-100,0,100]")
+ print(x_mean)
x_minus_mean = x - x_mean
- print "Estimated covariance of 10000 multivariate normals with covariance [[3,2,1],[2,2,1],[1,1,1]]"
- print np.dot(np.transpose(x_minus_mean),x_minus_mean)/9999.
+ print("Estimated covariance of 10000 multivariate normals with covariance [[3,2,1],[2,2,1],[1,1,1]]")
+ print(np.dot(np.transpose(x_minus_mean),x_minus_mean)/9999.)
x = beta(5.0, 10.0, 10000)
mean_var_test(x, "beta(5.,10.) random numbers", 0.333, 0.014)
x = gamma(.01, 2., 10000)
@@ -256,14 +256,14 @@ def test():
mean_var_test(x, "F random numbers with 5 and 10 degrees of freedom", 1.25, 1.35)
x = poisson(50., 10000)
mean_var_test(x, "poisson random numbers with mean 50", 50, 50, 0.14)
- print "\nEach element is the result of 16 binomial trials with probability 0.5:"
- print binomial(16, 0.5, 16)
- print "\nEach element is the result of 16 negative binomial trials with probability 0.5:"
- print negative_binomial(16, 0.5, [16,])
- print "\nEach row is the result of 16 multinomial trials with probabilities [0.1, 0.5, 0.1 0.3]:"
+ print("\nEach element is the result of 16 binomial trials with probability 0.5:")
+ print(binomial(16, 0.5, 16))
+ print("\nEach element is the result of 16 negative binomial trials with probability 0.5:")
+ print(negative_binomial(16, 0.5, [16,]))
+ print("\nEach row is the result of 16 multinomial trials with probabilities [0.1, 0.5, 0.1 0.3]:")
x = multinomial(16, [0.1, 0.5, 0.1], 8)
- print x
- print "Mean = ", np.sum(x,axis=0)/8.
+ print(x)
+ print("Mean = ", np.sum(x,axis=0)/8.)
if __name__ == '__main__':
test()
diff --git a/numpy/oldnumeric/rng.py b/numpy/oldnumeric/rng.py
index 3ad0b4190..1ffd47b27 100644
--- a/numpy/oldnumeric/rng.py
+++ b/numpy/oldnumeric/rng.py
@@ -4,7 +4,7 @@ Replace import RNG with import numpy.oldnumeric.rng as RNG.
It is for backwards compatibility only.
"""
-from __future__ import division, absolute_import
+from __future__ import division, absolute_import, print_function
__all__ = ['CreateGenerator','ExponentialDistribution','LogNormalDistribution',
'NormalDistribution', 'UniformDistribution', 'error', 'ranf',
diff --git a/numpy/oldnumeric/rng_stats.py b/numpy/oldnumeric/rng_stats.py
index 43d763046..ed4781e6c 100644
--- a/numpy/oldnumeric/rng_stats.py
+++ b/numpy/oldnumeric/rng_stats.py
@@ -1,4 +1,4 @@
-from __future__ import division, absolute_import
+from __future__ import division, absolute_import, print_function
__all__ = ['average', 'histogram', 'standardDeviation', 'variance']
diff --git a/numpy/oldnumeric/setup.py b/numpy/oldnumeric/setup.py
index 9482c216d..5dd8d3c5c 100644
--- a/numpy/oldnumeric/setup.py
+++ b/numpy/oldnumeric/setup.py
@@ -1,4 +1,4 @@
-from __future__ import division
+from __future__ import division, print_function
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
diff --git a/numpy/oldnumeric/tests/test_oldnumeric.py b/numpy/oldnumeric/tests/test_oldnumeric.py
index 488b2b471..5ff8e6bd3 100644
--- a/numpy/oldnumeric/tests/test_oldnumeric.py
+++ b/numpy/oldnumeric/tests/test_oldnumeric.py
@@ -1,4 +1,4 @@
-from __future__ import division, absolute_import
+from __future__ import division, absolute_import, print_function
import unittest
diff --git a/numpy/oldnumeric/tests/test_regression.py b/numpy/oldnumeric/tests/test_regression.py
index d169d6f3f..b62a384e4 100644
--- a/numpy/oldnumeric/tests/test_regression.py
+++ b/numpy/oldnumeric/tests/test_regression.py
@@ -1,4 +1,4 @@
-from __future__ import division, absolute_import
+from __future__ import division, absolute_import, print_function
from numpy.testing import *
diff --git a/numpy/oldnumeric/typeconv.py b/numpy/oldnumeric/typeconv.py
index c3a27f5a3..c4a8c4385 100644
--- a/numpy/oldnumeric/typeconv.py
+++ b/numpy/oldnumeric/typeconv.py
@@ -1,4 +1,4 @@
-from __future__ import division, absolute_import
+from __future__ import division, absolute_import, print_function
__all__ = ['oldtype2dtype', 'convtypecode', 'convtypecode2', 'oldtypecodes']
diff --git a/numpy/oldnumeric/ufuncs.py b/numpy/oldnumeric/ufuncs.py
index 7da0b5a93..4ab43cb1f 100644
--- a/numpy/oldnumeric/ufuncs.py
+++ b/numpy/oldnumeric/ufuncs.py
@@ -1,4 +1,4 @@
-from __future__ import division, absolute_import
+from __future__ import division, absolute_import, print_function
__all__ = ['less', 'cosh', 'arcsinh', 'add', 'ceil', 'arctan2', 'floor_divide',
'fmod', 'hypot', 'logical_and', 'power', 'sinh', 'remainder', 'cos',
diff --git a/numpy/oldnumeric/user_array.py b/numpy/oldnumeric/user_array.py
index 8d2421f4a..e5f3ecd01 100644
--- a/numpy/oldnumeric/user_array.py
+++ b/numpy/oldnumeric/user_array.py
@@ -1,4 +1,4 @@
-from __future__ import division, absolute_import
+from __future__ import division, absolute_import, print_function
from numpy.oldnumeric import *
from numpy.lib.user_array import container as UserArray