diff --git a/pandas/core/computation/eval.py b/pandas/core/computation/eval.py index 8614230c4811f..63344af63470f 100644 --- a/pandas/core/computation/eval.py +++ b/pandas/core/computation/eval.py @@ -198,14 +198,14 @@ def eval( `__, only Python `expressions `__. - parser : string, default 'pandas', {'pandas', 'python'} + parser : {'pandas', 'python'}, default 'pandas' The parser to use to construct the syntax tree from the expression. The default of ``'pandas'`` parses code slightly different than standard Python. Alternatively, you can parse an expression using the ``'python'`` parser to retain strict Python semantics. See the :ref:`enhancing performance ` documentation for more details. - engine : string or None, default 'numexpr', {'python', 'numexpr'} + engine : {'python', 'numexpr'}, default 'numexpr' The engine used to evaluate the expression. Supported engines are diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 5200ad0ba0d23..79e941f262931 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -6238,7 +6238,7 @@ def unstack(self, level=-1, fill_value=None): ---------- level : int, str, or list of these, default -1 (last level) Level(s) of index to unstack, can pass level name. - fill_value : int, string or dict + fill_value : int, str or dict Replace NaN with this value if the unstack produces missing values. Returns diff --git a/pandas/core/generic.py b/pandas/core/generic.py index fa269b4ebeab1..da8db23fb538b 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -2353,7 +2353,7 @@ def to_json( .. versionadded:: 0.23.0 - indent : integer, optional + indent : int, optional Length of whitespace used to indent each record. .. versionadded:: 1.0.0 diff --git a/pandas/core/groupby/generic.py b/pandas/core/groupby/generic.py index 7be11696b7d45..068d5e5275f0d 100644 --- a/pandas/core/groupby/generic.py +++ b/pandas/core/groupby/generic.py @@ -1644,7 +1644,7 @@ def nunique(self, dropna=True): Parameters ---------- - dropna : boolean, default True + dropna : bool, default True Don't include NaN in the counts. Returns diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index c9c02ad9e496a..7dee3a17f8f9e 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -4531,7 +4531,7 @@ def shift(self, periods=1, freq=None): periods : int, default 1 Number of periods (or increments) to shift by, can be positive or negative. - freq : pandas.DateOffset, pandas.Timedelta or string, optional + freq : pandas.DateOffset, pandas.Timedelta or str, optional Frequency increment to shift by. If None, the index is shifted by its own `freq` attribute. Offset aliases are valid strings, e.g., 'D', 'W', 'M' etc. diff --git a/pandas/core/indexes/category.py b/pandas/core/indexes/category.py index ed3a4a7953df3..b538c4df00e19 100644 --- a/pandas/core/indexes/category.py +++ b/pandas/core/indexes/category.py @@ -77,7 +77,7 @@ class CategoricalIndex(Index, accessor.PandasDelegate): Whether or not this categorical is treated as an ordered categorical. If not given here or in `dtype`, the resulting categorical will be unordered. - dtype : CategoricalDtype or the string "category", optional + dtype : CategoricalDtype or "category", optional If :class:`CategoricalDtype`, cannot be used together with `categories` or `ordered`. diff --git a/pandas/core/indexes/datetimes.py b/pandas/core/indexes/datetimes.py index 0b20df38e7d42..6a2f49cd1470e 100644 --- a/pandas/core/indexes/datetimes.py +++ b/pandas/core/indexes/datetimes.py @@ -1328,7 +1328,7 @@ def indexer_at_time(self, time, asof=False): Parameters ---------- - time : datetime.time or string + time : datetime.time or str datetime.time or string in appropriate format ("%H:%M", "%H%M", "%I:%M%p", "%I%M%p", "%H:%M:%S", "%H%M%S", "%I:%M:%S%p", "%I%M%S%p"). diff --git a/pandas/core/indexes/interval.py b/pandas/core/indexes/interval.py index 2cc15f7650ac1..a2d48b5100a2e 100644 --- a/pandas/core/indexes/interval.py +++ b/pandas/core/indexes/interval.py @@ -1412,11 +1412,11 @@ def interval_range( Right bound for generating intervals periods : int, default None Number of periods to generate - freq : numeric, string, or DateOffset, default None + freq : numeric, str, or DateOffset, default None The length of each interval. Must be consistent with the type of start and end, e.g. 2 for numeric, or '5H' for datetime-like. Default is 1 for numeric and 'D' for datetime-like. - name : string, default None + name : str, default None Name of the resulting IntervalIndex closed : {'left', 'right', 'both', 'neither'}, default 'right' Whether the intervals are closed on the left-side, right-side, both diff --git a/pandas/core/indexes/multi.py b/pandas/core/indexes/multi.py index 2007da541bb2e..596eaf0c55dbd 100644 --- a/pandas/core/indexes/multi.py +++ b/pandas/core/indexes/multi.py @@ -1650,7 +1650,7 @@ def to_frame(self, index=True, name=None): Parameters ---------- - index : boolean, default True + index : bool, default True Set the index of the returned DataFrame as the original MultiIndex. name : list / sequence of strings, optional @@ -2334,7 +2334,7 @@ def sortlevel(self, level=0, ascending=True, sort_remaining=True): level : list-like, int or str, default 0 If a string is given, must be a name of the level If list-like must be names or ints of levels. - ascending : boolean, default True + ascending : bool, default True False to sort in descending order Can also be a list to specify a directed ordering sort_remaining : sort by the remaining levels after level diff --git a/pandas/core/reshape/tile.py b/pandas/core/reshape/tile.py index be5d75224e77d..6942a5797a7f0 100644 --- a/pandas/core/reshape/tile.py +++ b/pandas/core/reshape/tile.py @@ -285,10 +285,10 @@ def qcut(x, q, labels=None, retbins=False, precision=3, duplicates="raise"): Parameters ---------- x : 1d ndarray or Series - q : integer or array of quantiles + q : int or list-like of int Number of quantiles. 10 for deciles, 4 for quartiles, etc. Alternately array of quantiles, e.g. [0, .25, .5, .75, 1.] for quartiles - labels : array or boolean, default None + labels : array or bool, default None Used as labels for the resulting bins. Must be of the same length as the resulting bins. If False, return only integer indicators of the bins. diff --git a/pandas/core/tools/numeric.py b/pandas/core/tools/numeric.py index fa33d11bda7eb..05696ffd4605d 100644 --- a/pandas/core/tools/numeric.py +++ b/pandas/core/tools/numeric.py @@ -39,7 +39,7 @@ def to_numeric(arg, errors="raise", downcast=None): - If 'raise', then invalid parsing will raise an exception - If 'coerce', then invalid parsing will be set as NaN - If 'ignore', then invalid parsing will return the input - downcast : {'integer', 'signed', 'unsigned', 'float'} , default None + downcast : {'integer', 'signed', 'unsigned', 'float'}, default None If not None, and if the data has been successfully cast to a numerical dtype (or if the data was numeric to begin with), downcast that resulting data to the smallest numerical dtype diff --git a/pandas/io/json/_json.py b/pandas/io/json/_json.py index 6ce288890b6c7..c71677fa3b570 100644 --- a/pandas/io/json/_json.py +++ b/pandas/io/json/_json.py @@ -384,7 +384,7 @@ def read_json( By file-like object, we refer to objects with a ``read()`` method, such as a file handler (e.g. via builtin ``open`` function) or ``StringIO``. - orient : string, + orient : str Indication of expected JSON string format. Compatible JSON strings can be produced by ``to_json()`` with a corresponding orient value. diff --git a/pandas/io/parsers.py b/pandas/io/parsers.py index 3678e32943b2e..c82486532530f 100755 --- a/pandas/io/parsers.py +++ b/pandas/io/parsers.py @@ -257,7 +257,7 @@ arguments. dayfirst : bool, default False DD/MM format dates, international and European format. -cache_dates : boolean, default True +cache_dates : bool, default True If True, use a cache of unique, converted dates to apply the datetime conversion. May produce significant speed-up when parsing duplicate date strings, especially ones with timezone offsets. diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index 0db5b1b4eecfa..c87cad5472bd9 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -1025,8 +1025,8 @@ def append( Write as a PyTables Table structure which may perform worse but allow more flexible operations like searching / selecting subsets of the data - append : boolean, default True, append the input data to the - existing + append : bool, default True + Append the input data to the existing. data_columns : list of columns, or True, default None List of columns to create as indexed data columns for on-disk queries, or True to use all columns. By default only the axes @@ -1037,8 +1037,9 @@ def append( chunksize : size to chunk the writing expectedrows : expected TOTAL row size of this table encoding : default None, provide an encoding for strings - dropna : boolean, default False, do not write an ALL nan row to - the store settable by the option 'io.hdf.dropna_table' + dropna : bool, default False + Do not write an ALL nan row to the store settable + by the option 'io.hdf.dropna_table'. Notes ----- diff --git a/pandas/io/sql.py b/pandas/io/sql.py index b0683fb8b0dfb..822b3288c82d9 100644 --- a/pandas/io/sql.py +++ b/pandas/io/sql.py @@ -287,7 +287,7 @@ def read_sql_query( If a DBAPI2 object, only sqlite3 is supported. index_col : string or list of strings, optional, default: None Column(s) to set as index(MultiIndex). - coerce_float : boolean, default True + coerce_float : bool, default True Attempts to convert values of non-string, non-numeric objects (like decimal.Decimal) to floating point. Useful for SQL result sets. params : list, tuple or dict, optional, default: None diff --git a/pandas/io/stata.py b/pandas/io/stata.py index 0b674b556b2ee..679b74caba79e 100644 --- a/pandas/io/stata.py +++ b/pandas/io/stata.py @@ -53,31 +53,31 @@ ) _statafile_processing_params1 = """\ -convert_dates : boolean, defaults to True +convert_dates : bool, default True Convert date variables to DataFrame time values. -convert_categoricals : boolean, defaults to True +convert_categoricals : bool, default True Read value labels and convert columns to Categorical/Factor variables.""" _encoding_params = """\ -encoding : string, None or encoding +encoding : str, None or encoding Encoding used to parse the files. None defaults to latin-1.""" _statafile_processing_params2 = """\ -index_col : string, optional, default: None +index_col : str, optional Column to set as index. -convert_missing : boolean, defaults to False +convert_missing : bool, default False Flag indicating whether to convert missing values to their Stata representations. If False, missing values are replaced with nan. If True, columns containing missing values are returned with object data types and missing values are represented by StataMissingValue objects. -preserve_dtypes : boolean, defaults to True +preserve_dtypes : bool, default True Preserve Stata datatypes. If False, numeric data are upcast to pandas default types for foreign data (float64 or int64). columns : list or None Columns to retain. Columns will be returned in the given order. None returns all columns. -order_categoricals : boolean, defaults to True +order_categoricals : bool, default True Flag indicating whether converted categorical data are ordered.""" _chunksize_params = """\ @@ -86,7 +86,7 @@ given number of lines.""" _iterator_params = """\ -iterator : boolean, default False +iterator : bool, default False Return StataReader object.""" _read_stata_doc = """ diff --git a/pandas/tseries/frequencies.py b/pandas/tseries/frequencies.py index 4491e6ad9ac7e..0dcd8aeb4df9b 100644 --- a/pandas/tseries/frequencies.py +++ b/pandas/tseries/frequencies.py @@ -223,7 +223,7 @@ def infer_freq(index, warn=True): ---------- index : DatetimeIndex or TimedeltaIndex if passed a Series will use the values of the series (NOT THE INDEX) - warn : boolean, default True + warn : bool, default True Returns -------