summaryrefslogtreecommitdiff
path: root/numpy/lib/npyio.py
diff options
context:
space:
mode:
authorPranab Das <31024886+pranabdas@users.noreply.github.com>2022-06-27 21:07:34 +0800
committerGitHub <noreply@github.com>2022-06-27 06:07:34 -0700
commita2caa35dd9f2dae9f492a1af9faa1619e4fcce02 (patch)
tree5da02f7c56e89d5f5be188f8f591d5118fb7682b /numpy/lib/npyio.py
parent284345dcfe82e11650c8bd5472a80312b3d0bf3f (diff)
downloadnumpy-a2caa35dd9f2dae9f492a1af9faa1619e4fcce02.tar.gz
DOC: mention changes to `max_rows` behaviour in `np.loadtxt` (#21854)
* DOC: mention changes to `max_rows` behaviour * Clarify how line counting works in max_rows
Diffstat (limited to 'numpy/lib/npyio.py')
-rw-r--r--numpy/lib/npyio.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py
index 210c0ea94..52bcf25f8 100644
--- a/numpy/lib/npyio.py
+++ b/numpy/lib/npyio.py
@@ -1129,10 +1129,17 @@ def loadtxt(fname, dtype=float, comments='#', delimiter=None,
.. versionadded:: 1.14.0
max_rows : int, optional
- Read `max_rows` lines of content after `skiprows` lines. The default
- is to read all the lines.
+ Read `max_rows` rows of content after `skiprows` lines. The default is
+ to read all the rows. Note that empty rows containing no data such as
+ empty lines and comment lines are not counted towards `max_rows`,
+ while such lines are counted in `skiprows`.
.. versionadded:: 1.16.0
+
+ .. versionchanged:: 1.23.0
+ Lines containing no data, including comment lines (e.g., lines
+ starting with '#' or as specified via `comments`) are not counted
+ towards `max_rows`.
quotechar : unicode character or None, optional
The character used to denote the start and end of a quoted item.
Occurrences of the delimiter or comment characters are ignored within