diff options
Diffstat (limited to 'numpy')
| -rw-r--r-- | numpy/ma/mrecords.py | 8 | ||||
| -rw-r--r-- | numpy/ma/mrecords.pyi | 2 | ||||
| -rw-r--r-- | numpy/ma/tests/test_mrecords.py | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/numpy/ma/mrecords.py b/numpy/ma/mrecords.py index bdce8b3bd..10b1b209c 100644 --- a/numpy/ma/mrecords.py +++ b/numpy/ma/mrecords.py @@ -667,7 +667,7 @@ def openfile(fname): raise NotImplementedError("Wow, binary file") -def fromtextfile(fname, delimiter=None, commentchar='#', missingchar='', +def fromtextfile(fname, delimitor=None, commentchar='#', missingchar='', varnames=None, vartypes=None): """ Creates a mrecarray from data stored in the file `filename`. @@ -676,7 +676,7 @@ def fromtextfile(fname, delimiter=None, commentchar='#', missingchar='', ---------- fname : {file name/handle} Handle of an opened file. - delimiter : {None, string}, optional + delimitor : {None, string}, optional Alphanumeric character used to separate columns in the file. If None, any (group of) white spacestring(s) will be used. commentchar : {'#', string}, optional @@ -699,14 +699,14 @@ def fromtextfile(fname, delimiter=None, commentchar='#', missingchar='', while True: line = ftext.readline() firstline = line[:line.find(commentchar)].strip() - _varnames = firstline.split(delimiter) + _varnames = firstline.split(delimitor) if len(_varnames) > 1: break if varnames is None: varnames = _varnames # Get the data. - _variables = masked_array([line.strip().split(delimiter) for line in ftext + _variables = masked_array([line.strip().split(delimitor) for line in ftext if line[0] != commentchar and len(line) > 1]) (_, nfields) = _variables.shape ftext.close() diff --git a/numpy/ma/mrecords.pyi b/numpy/ma/mrecords.pyi index cdd5347d6..92d5afb89 100644 --- a/numpy/ma/mrecords.pyi +++ b/numpy/ma/mrecords.pyi @@ -78,7 +78,7 @@ def fromrecords( def fromtextfile( fname, - delimiter=..., + delimitor=..., commentchar=..., missingchar=..., varnames=..., diff --git a/numpy/ma/tests/test_mrecords.py b/numpy/ma/tests/test_mrecords.py index 4b2c01df9..27df519d2 100644 --- a/numpy/ma/tests/test_mrecords.py +++ b/numpy/ma/tests/test_mrecords.py @@ -468,7 +468,7 @@ class TestMRecordsImport: with temppath() as path: with open(path, 'w') as f: f.write(fcontent) - mrectxt = fromtextfile(path, delimiter=',', varnames='ABCDEFG') + mrectxt = fromtextfile(path, delimitor=',', varnames='ABCDEFG') assert_(isinstance(mrectxt, MaskedRecords)) assert_equal(mrectxt.F, [1, 1, 1, 1]) assert_equal(mrectxt.E._mask, [1, 1, 1, 1]) |
