summaryrefslogtreecommitdiff
path: root/numpy/lib/npyio.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/npyio.py')
-rw-r--r--numpy/lib/npyio.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py
index 237d7e4ef..e62447eb0 100644
--- a/numpy/lib/npyio.py
+++ b/numpy/lib/npyio.py
@@ -1085,15 +1085,18 @@ def loadtxt(fname, dtype=float, comments='#', delimiter=None,
comment. None implies no comments. For backwards compatibility, byte
strings will be decoded as 'latin1'. The default is '#'.
delimiter : str, optional
- The string used to separate values. For backwards compatibility, byte
- strings will be decoded as 'latin1'. The default is whitespace.
+ The character used to separate the values. For backwards compatibility,
+ byte strings will be decoded as 'latin1'. The default is whitespace.
+
+ .. versionchanged:: 1.23.0
+ Only single character delimiters are supported. Newline characters
+ cannot be used as the delimiter.
+
converters : dict or callable, optional
- A function to parse all columns strings into the desired value, or
- a dictionary mapping column number to a parser function.
- E.g. if column 0 is a date string: ``converters = {0: datestr2num}``.
- Converters can also be used to provide a default value for missing
- data, e.g. ``converters = lambda s: float(s.strip() or 0)`` will
- convert empty fields to 0.
+ Converter functions to customize value parsing. If `converters` is
+ callable, the function is applied to all columns, else it must be a
+ dict that maps column number to a parser function.
+ See examples for further details.
Default: None.
.. versionchanged:: 1.23.0