diff --git a/doc/source/user_guide/io.rst b/doc/source/user_guide/io.rst index c2ca3df5ca23d..e2f8ac09d8873 100644 --- a/doc/source/user_guide/io.rst +++ b/doc/source/user_guide/io.rst @@ -102,7 +102,7 @@ header : int or list of ints, default ``'infer'`` 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 are not allowed. -index_col : int, str, sequence of int / str, or False, default ``None`` +index_col : int, str, sequence of int / str, or False, optional, 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. @@ -120,7 +120,8 @@ 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 that correspond to column names provided either by the user in ``names`` or - inferred from the document header row(s). For example, a valid list-like + inferred from the document header row(s). If ``names`` are given, the document + header row(s) are not taken into account. For example, a valid list-like ``usecols`` parameter would be ``[0, 1, 2]`` or ``['foo', 'bar', 'baz']``. Element order is ignored, so ``usecols=[0, 1]`` is the same as ``[1, 0]``. To @@ -348,7 +349,7 @@ dialect : str or :class:`python:csv.Dialect` instance, default ``None`` Error handling ++++++++++++++ -error_bad_lines : boolean, default ``None`` +error_bad_lines : boolean, optional, default ``None`` Lines with too many fields (e.g. a csv line with too many commas) will by default cause an exception to be raised, and no ``DataFrame`` will be returned. If ``False``, then these "bad lines" will dropped from the @@ -358,7 +359,7 @@ error_bad_lines : boolean, default ``None`` .. deprecated:: 1.3.0 The ``on_bad_lines`` parameter should be used instead to specify behavior upon encountering a bad line instead. -warn_bad_lines : boolean, default ``None`` +warn_bad_lines : boolean, optional, default ``None`` If error_bad_lines is ``False``, and warn_bad_lines is ``True``, a warning for each "bad line" will be output. diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 212bb63693d56..1b89eeddcf9df 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -1044,12 +1044,14 @@ def _repr_html_(self) -> str | None: return None @Substitution( - header_type="bool or sequence", + header_type="bool or sequence of strings", header="Write out the column names. If a list of strings " "is given, it is assumed to be aliases for the " "column names", col_space_type="int, list or dict of int", - col_space="The minimum width of each column", + col_space="The minimum width of each column. If a list of ints is given " + "every integers corresponds with one column. If a dict is given, the key " + "references the column, while the value defines the space to use.", ) @Substitution(shared_params=fmt.common_docstring, returns=fmt.return_docstring) def to_string( diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 9715bf8f61f3c..a8896c1fde546 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -6681,8 +6681,6 @@ def all(self, *args, **kwargs): Examples -------- - **all** - True, because nonzero integers are considered True. >>> pd.Index([1, 2, 3]).all() @@ -6692,18 +6690,6 @@ def all(self, *args, **kwargs): >>> pd.Index([0, 1, 2]).all() False - - **any** - - True, because ``1`` is considered True. - - >>> pd.Index([0, 0, 1]).any() - True - - False, because ``0`` is considered False. - - >>> pd.Index([0, 0, 0]).any() - False """ nv.validate_all(args, kwargs) self._maybe_disable_logical_methods("all") diff --git a/pandas/io/parsers/readers.py b/pandas/io/parsers/readers.py index 6fb9497dbc1d6..0b57f0f5ef814 100644 --- a/pandas/io/parsers/readers.py +++ b/pandas/io/parsers/readers.py @@ -104,7 +104,7 @@ List of column names to use. If the file contains a header row, then you should explicitly pass ``header=0`` to override the column names. Duplicates in this list are not allowed. -index_col : int, str, sequence of int / str, or False, default ``None`` +index_col : int, str, sequence of int / str, or False, optional, 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. @@ -116,7 +116,8 @@ 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 that correspond to column names provided either by the user in `names` or - inferred from the document header row(s). For example, a valid list-like + inferred from the document header row(s). If ``names`` are given, the document + header row(s) are not taken into account. For example, a valid list-like `usecols` parameter would be ``[0, 1, 2]`` or ``['foo', 'bar', 'baz']``. Element order is ignored, so ``usecols=[0, 1]`` is the same as ``[1, 0]``. To instantiate a DataFrame from ``data`` with element order preserved use @@ -331,7 +332,7 @@ `skipinitialspace`, `quotechar`, and `quoting`. If it is necessary to override values, a ParserWarning will be issued. See csv.Dialect documentation for more details. -error_bad_lines : bool, default ``None`` +error_bad_lines : bool, optional, default ``None`` Lines with too many fields (e.g. a csv line with too many commas) will by default cause an exception to be raised, and no DataFrame will be returned. If False, then these "bad lines" will be dropped from the DataFrame that is @@ -340,7 +341,7 @@ .. deprecated:: 1.3.0 The ``on_bad_lines`` parameter should be used instead to specify behavior upon encountering a bad line instead. -warn_bad_lines : bool, default ``None`` +warn_bad_lines : bool, optional, default ``None`` If error_bad_lines is False, and warn_bad_lines is True, a warning for each "bad line" will be output.