diff options
author | Jesús Gómez <jgomo3@gmail.com> | 2013-07-17 09:23:16 -0430 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2013-08-01 11:59:02 -0600 |
commit | eacca11823c5d05c86ec9e715773347d5803c32e (patch) | |
tree | 17b8a36b9f5b390beeeb0cc35112e9672b4f026c | |
parent | 5635b6820bb237c7ae95e7943616b9f677797526 (diff) | |
download | numpy-eacca11823c5d05c86ec9e715773347d5803c32e.tar.gz |
DOC: Fixes for doc/source/user/basics.io.genfromtxt.rst.
Add missing part of usecols negative index explanation and other
minor redaction fixes.
-rw-r--r-- | doc/source/user/basics.io.genfromtxt.rst | 4 | ||||
-rw-r--r-- | numpy/doc/creation.py | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/doc/source/user/basics.io.genfromtxt.rst b/doc/source/user/basics.io.genfromtxt.rst index 814ba520a..82c7a661a 100644 --- a/doc/source/user/basics.io.genfromtxt.rst +++ b/doc/source/user/basics.io.genfromtxt.rst @@ -150,7 +150,7 @@ In some cases, we are not interested in all the columns of the data but only a f We can select which columns to import with the :keyword:`usecols` argument. This argument accepts a single integer or a sequence of integers corresponding to the indices of the columns to import. Remember that by convention, the first column has an index of 0. -Negative integers correspond to +Negative integers behave the same as regular Python negative indexes. For example, if we want to import only the first and the last columns, we can use ``usecols=(0, -1)``: >>> data = "1 2 3\n4 5 6" @@ -301,7 +301,7 @@ However, some additional control may sometimes be required. For example, we may want to make sure that a date in a format ``YYYY/MM/DD`` is converted to a :class:`datetime` object, or that a string like ``xx%`` is properly converted to a float between 0 and 1. In such cases, we should define conversion functions with the :keyword:`converters` arguments. -The value of this argument is typically a dictionary with column indices or column names as keys and a conversion function as values. +The value of this argument is typically a dictionary with column indices or column names as keys and a conversion functions as values. These conversion functions can either be actual functions or lambda functions. In any case, they should accept only a string as input and output only a single element of the wanted type. In the following example, the second column is converted from as string representing a percentage to a float between 0 and 1 diff --git a/numpy/doc/creation.py b/numpy/doc/creation.py index b096edd3d..e00c26e54 100644 --- a/numpy/doc/creation.py +++ b/numpy/doc/creation.py @@ -106,9 +106,9 @@ check the last section as well) HDF5: PyTables FITS: PyFITS -Examples of formats that cannot be read directly but for which it is not hard -to convert are libraries like PIL (able to read and write many image formats -such as jpg, png, etc). +Examples of formats that cannot be read directly but for which it is not hard to +convert are those formats supported by libraries like PIL (able to read and +write many image formats such as jpg, png, etc). Common ASCII Formats ------------------------ |