summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/lib/npyio.py30
-rw-r--r--numpy/lib/npyio.pyi1
-rw-r--r--numpy/lib/tests/test_io.py11
-rw-r--r--numpy/tests/test_public_api.py1
4 files changed, 1 insertions, 42 deletions
diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py
index 58133056f..08abac0ba 100644
--- a/numpy/lib/npyio.py
+++ b/numpy/lib/npyio.py
@@ -27,7 +27,7 @@ from numpy.compat import (
__all__ = [
- 'savetxt', 'loadtxt', 'genfromtxt', 'ndfromtxt', 'mafromtxt',
+ 'savetxt', 'loadtxt', 'genfromtxt', 'mafromtxt',
'recfromtxt', 'recfromcsv', 'load', 'save', 'savez',
'savez_compressed', 'packbits', 'unpackbits', 'fromregex', 'DataSource'
]
@@ -2301,34 +2301,6 @@ _genfromtxt_with_like = array_function_dispatch(
)(genfromtxt)
-def ndfromtxt(fname, **kwargs):
- """
- Load ASCII data stored in a file and return it as a single array.
-
- .. deprecated:: 1.17
- ndfromtxt` is a deprecated alias of `genfromtxt` which
- overwrites the ``usemask`` argument with `False` even when
- explicitly called as ``ndfromtxt(..., usemask=True)``.
- Use `genfromtxt` instead.
-
- Parameters
- ----------
- fname, kwargs : For a description of input parameters, see `genfromtxt`.
-
- See Also
- --------
- numpy.genfromtxt : generic function.
-
- """
- kwargs['usemask'] = False
- # Numpy 1.17
- warnings.warn(
- "np.ndfromtxt is a deprecated alias of np.genfromtxt, "
- "prefer the latter.",
- DeprecationWarning, stacklevel=2)
- return genfromtxt(fname, **kwargs)
-
-
def mafromtxt(fname, **kwargs):
"""
Load ASCII data stored in a text file and return a masked array.
diff --git a/numpy/lib/npyio.pyi b/numpy/lib/npyio.pyi
index 407175661..22e689d79 100644
--- a/numpy/lib/npyio.pyi
+++ b/numpy/lib/npyio.pyi
@@ -98,5 +98,4 @@ def recfromtxt(fname, **kwargs): ...
def recfromcsv(fname, **kwargs): ...
# NOTE: Deprecated
-# def ndfromtxt(fname, **kwargs): ...
# def mafromtxt(fname, **kwargs): ...
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py
index d97ad76df..aa0037d32 100644
--- a/numpy/lib/tests/test_io.py
+++ b/numpy/lib/tests/test_io.py
@@ -2503,17 +2503,6 @@ class TestPathUsage:
data = np.genfromtxt(path)
assert_array_equal(a, data)
- def test_ndfromtxt(self):
- # Test outputting a standard ndarray
- with temppath(suffix='.txt') as path:
- path = Path(path)
- with path.open('w') as f:
- f.write(u'1 2\n3 4')
-
- control = np.array([[1, 2], [3, 4]], dtype=int)
- test = np.genfromtxt(path, dtype=int)
- assert_array_equal(test, control)
-
def test_mafromtxt(self):
# From `test_fancy_dtype_alt` above
with temppath(suffix='.txt') as path:
diff --git a/numpy/tests/test_public_api.py b/numpy/tests/test_public_api.py
index 6e4a8dee0..a40275eb7 100644
--- a/numpy/tests/test_public_api.py
+++ b/numpy/tests/test_public_api.py
@@ -46,7 +46,6 @@ def test_numpy_namespace():
'get_array_wrap': 'numpy.lib.shape_base.get_array_wrap',
'get_include': 'numpy.lib.utils.get_include',
'mafromtxt': 'numpy.lib.npyio.mafromtxt',
- 'ndfromtxt': 'numpy.lib.npyio.ndfromtxt',
'recfromcsv': 'numpy.lib.npyio.recfromcsv',
'recfromtxt': 'numpy.lib.npyio.recfromtxt',
'safe_eval': 'numpy.lib.utils.safe_eval',