diff --git a/doc/source/user_guide/io.rst b/doc/source/user_guide/io.rst index b23a0f10e9e2b..ee0b156027f5e 100644 --- a/doc/source/user_guide/io.rst +++ b/doc/source/user_guide/io.rst @@ -110,11 +110,14 @@ names : array-like, default ``None`` List of column names to use. If file contains no header row, then you should explicitly pass ``header=None``. Duplicates in this list will cause a ``UserWarning`` to be issued. -index_col : int or sequence or ``False``, default ``None`` - Column to use as the row labels of the ``DataFrame``. If a sequence is given, a - MultiIndex is used. If you have a malformed file with delimiters at the end of - each line, you might consider ``index_col=False`` to force pandas to *not* use - the first column as the index (row names). +index_col : int, str, sequence of int / str, or False, default ``None`` + Column(s) to use as the row labels of the ``DataFrame``, either given as + string name or column index. If a sequence of int / str is given, a + MultiIndex is used. + + Note: ``index_col=False`` can be used to force pandas to *not* use the first + column as the index, e.g. when you have a malformed file with delimiters at + the end of each line. usecols : list-like or callable, default ``None`` Return a subset of the columns. If list-like, all elements must either be positional (i.e. integer indices into the document columns) or strings diff --git a/pandas/io/parsers.py b/pandas/io/parsers.py index 4163a571df800..4e465f39aa3e5 100755 --- a/pandas/io/parsers.py +++ b/pandas/io/parsers.py @@ -102,11 +102,14 @@ List of column names to use. If file contains no header row, then you should explicitly pass ``header=None``. Duplicates in this list will cause a ``UserWarning`` to be issued. -index_col : int, sequence or bool, optional - Column to use as the row labels of the DataFrame. If a sequence is given, a - MultiIndex is used. If you have a malformed file with delimiters at the end - of each line, you might consider ``index_col=False`` to force pandas to - not use the first column as the index (row names). +index_col : int, str, sequence of int / str, or False, default ``None`` + Column(s) to use as the row labels of the ``DataFrame``, either given as + string name or column index. If a sequence of int / str is given, a + MultiIndex is used. + + Note: ``index_col=False`` can be used to force pandas to *not* use the first + column as the index, e.g. when you have a malformed file with delimiters at + the end of each line. usecols : list-like or callable, optional Return a subset of the columns. If list-like, all elements must either be positional (i.e. integer indices into the document columns) or strings