import numpy as np
[3]:
np.version
[3]:
‘1.21.4’
[4]:
import numpy as np
[5]:
np.loadtxt(‘data.txt’)
OSError Traceback (most recent call last)
Input In [5], in <cell line: 1>()
----> 1 np.loadtxt(‘data.txt’)
File /lib/python3.9/site-packages/numpy/lib/npyio.py:1067, in loadtxt(fname, dtype, comments, delimiter, converters, skiprows, usecols, unpack, ndmin, encoding, max_rows, like)
1065 fname = os_fspath(fname)
1066 if _is_string_like(fname):
→ 1067 fh = np.lib._datasource.open(fname, ‘rt’, encoding=encoding)
1068 fencoding = getattr(fh, ‘encoding’, ‘latin1’)
1069 fh = iter(fh)
File /lib/python3.9/site-packages/numpy/lib/_datasource.py:193, in open(path, mode, destpath, encoding, newline)
156 “”"
157 Open path with mode and return the file object.
158
(…)
189
190 “”"
192 ds = DataSource(destpath)
→ 193 return ds.open(path, mode, encoding=encoding, newline=newline)
File /lib/python3.9/site-packages/numpy/lib/_datasource.py:533, in DataSource.open(self, path, mode, encoding, newline)
530 return _file_openers[ext](found, mode=mode,
531 encoding=encoding, newline=newline)
532 else:
→ 533 raise IOError(“%s not found.” % path)
OSError: data.txt not found.