From e07a832dbc763db7e594c20de4fde6293d2043fd Mon Sep 17 00:00:00 2001 From: Brock Date: Tue, 30 Mar 2021 17:59:35 -0700 Subject: [PATCH] DOC: boolean->bool, string->str in docstrings --- pandas/_libs/algos.pyx | 4 ++-- pandas/_libs/groupby.pyx | 8 ++++---- pandas/_libs/hashtable_class_helper.pxi.in | 18 +++++++++--------- pandas/_libs/reshape.pyx | 4 ++-- pandas/_libs/tslibs/conversion.pyx | 2 +- pandas/_libs/tslibs/fields.pyx | 6 +++--- pandas/_libs/tslibs/timedeltas.pyx | 2 +- pandas/_testing/__init__.py | 2 +- pandas/core/algorithms.py | 6 +++--- pandas/core/array_algos/take.py | 2 +- pandas/core/dtypes/cast.py | 2 +- pandas/core/frame.py | 4 ++-- pandas/core/generic.py | 2 +- pandas/core/groupby/categorical.py | 6 +++--- pandas/core/groupby/grouper.py | 2 +- pandas/core/groupby/ops.py | 4 ++-- pandas/core/indexing.py | 2 +- pandas/core/missing.py | 2 +- pandas/core/resample.py | 2 +- pandas/core/series.py | 2 +- pandas/core/sorting.py | 2 +- pandas/core/tools/datetimes.py | 6 +++--- pandas/io/clipboards.py | 2 +- pandas/io/common.py | 4 ++-- pandas/io/excel/_odfreader.py | 2 +- pandas/io/excel/_openpyxl.py | 2 +- pandas/io/excel/_xlrd.py | 2 +- pandas/io/formats/excel.py | 10 +++++----- pandas/io/formats/printing.py | 2 +- pandas/io/formats/style.py | 2 +- pandas/io/json/_table_schema.py | 2 +- pandas/io/parsers/readers.py | 2 +- pandas/io/pytables.py | 4 ++-- pandas/io/sas/sas7bdat.py | 4 ++-- pandas/io/sas/sas_xport.py | 8 ++++---- pandas/io/sql.py | 16 ++++++++-------- pandas/plotting/_matplotlib/converter.py | 2 +- pandas/tests/frame/test_reductions.py | 8 ++++---- pandas/tseries/frequencies.py | 2 +- 39 files changed, 82 insertions(+), 82 deletions(-) diff --git a/pandas/_libs/algos.pyx b/pandas/_libs/algos.pyx index a4bc2443e0eeb..b097fe20787f7 100644 --- a/pandas/_libs/algos.pyx +++ b/pandas/_libs/algos.pyx @@ -987,10 +987,10 @@ def rank_1d( * max: highest rank in group * first: ranks assigned in order they appear in the array * dense: like 'min', but rank always increases by 1 between groups - ascending : boolean, default True + ascending : bool, default True False for ranks by high (1) to low (N) na_option : {'keep', 'top', 'bottom'}, default 'keep' - pct : boolean, default False + pct : bool, default False Compute percentage rank of data within each group na_option : {'keep', 'top', 'bottom'}, default 'keep' * keep: leave NA values where they are diff --git a/pandas/_libs/groupby.pyx b/pandas/_libs/groupby.pyx index e23fa9b82f12e..3064ca9261b56 100644 --- a/pandas/_libs/groupby.pyx +++ b/pandas/_libs/groupby.pyx @@ -402,9 +402,9 @@ def group_any_all(uint8_t[::1] out, ordering matching up to the corresponding record in `values` values : array containing the truth value of each element mask : array indicating whether a value is na or not - val_test : str {'any', 'all'} + val_test : {'any', 'all'} String object dictating whether to use any or all truth testing - skipna : boolean + skipna : bool Flag to ignore nan values during truth testing Notes @@ -1083,10 +1083,10 @@ def group_rank(float64_t[:, ::1] out, * max: highest rank in group * first: ranks assigned in order they appear in the array * dense: like 'min', but rank always increases by 1 between groups - ascending : boolean, default True + ascending : bool, default True False for ranks by high (1) to low (N) na_option : {'keep', 'top', 'bottom'}, default 'keep' - pct : boolean, default False + pct : bool, default False Compute percentage rank of data within each group na_option : {'keep', 'top', 'bottom'}, default 'keep' * keep: leave NA values where they are diff --git a/pandas/_libs/hashtable_class_helper.pxi.in b/pandas/_libs/hashtable_class_helper.pxi.in index 6ace327ca3599..3b472b162cdff 100644 --- a/pandas/_libs/hashtable_class_helper.pxi.in +++ b/pandas/_libs/hashtable_class_helper.pxi.in @@ -523,7 +523,7 @@ cdef class {{name}}HashTable(HashTable): any value "val" satisfying val != val is considered missing. If na_value is not None, then _additionally_, any value "val" satisfying val == na_value is considered missing. - ignore_na : boolean, default False + ignore_na : bool, default False Whether NA-values should be ignored for calculating the uniques. If True, the labels corresponding to missing values will be set to na_sentinel. @@ -531,7 +531,7 @@ cdef class {{name}}HashTable(HashTable): If not None, the mask is used as indicator for missing values (True = missing, False = valid) instead of `na_value` or condition "val != val". - return_inverse : boolean, default False + return_inverse : bool, default False Whether the mapping of the original array values to their location in the vector of uniques should be returned. @@ -625,7 +625,7 @@ cdef class {{name}}HashTable(HashTable): ---------- values : ndarray[{{dtype}}] Array of values of which unique will be calculated - return_inverse : boolean, default False + return_inverse : bool, default False Whether the mapping of the original array values to their location in the vector of uniques should be returned. @@ -906,11 +906,11 @@ cdef class StringHashTable(HashTable): that is not a string is considered missing. If na_value is not None, then _additionally_ any value "val" satisfying val == na_value is considered missing. - ignore_na : boolean, default False + ignore_na : bool, default False Whether NA-values should be ignored for calculating the uniques. If True, the labels corresponding to missing values will be set to na_sentinel. - return_inverse : boolean, default False + return_inverse : bool, default False Whether the mapping of the original array values to their location in the vector of uniques should be returned. @@ -998,7 +998,7 @@ cdef class StringHashTable(HashTable): ---------- values : ndarray[object] Array of values of which unique will be calculated - return_inverse : boolean, default False + return_inverse : bool, default False Whether the mapping of the original array values to their location in the vector of uniques should be returned. @@ -1181,11 +1181,11 @@ cdef class PyObjectHashTable(HashTable): any value "val" satisfying val != val is considered missing. If na_value is not None, then _additionally_, any value "val" satisfying val == na_value is considered missing. - ignore_na : boolean, default False + ignore_na : bool, default False Whether NA-values should be ignored for calculating the uniques. If True, the labels corresponding to missing values will be set to na_sentinel. - return_inverse : boolean, default False + return_inverse : bool, default False Whether the mapping of the original array values to their location in the vector of uniques should be returned. @@ -1251,7 +1251,7 @@ cdef class PyObjectHashTable(HashTable): ---------- values : ndarray[object] Array of values of which unique will be calculated - return_inverse : boolean, default False + return_inverse : bool, default False Whether the mapping of the original array values to their location in the vector of uniques should be returned. diff --git a/pandas/_libs/reshape.pyx b/pandas/_libs/reshape.pyx index 05b255c40f4b2..8cf48ef04ac31 100644 --- a/pandas/_libs/reshape.pyx +++ b/pandas/_libs/reshape.pyx @@ -48,13 +48,13 @@ def unstack(reshape_t[:, :] values, const uint8_t[:] mask, Parameters ---------- values : typed ndarray - mask : boolean ndarray + mask : np.ndarray[bool] stride : int length : int width : int new_values : typed ndarray result array - new_mask : boolean ndarray + new_mask : np.ndarray[bool] result mask """ cdef: diff --git a/pandas/_libs/tslibs/conversion.pyx b/pandas/_libs/tslibs/conversion.pyx index 56280d55e479d..893c0fa52cd15 100644 --- a/pandas/_libs/tslibs/conversion.pyx +++ b/pandas/_libs/tslibs/conversion.pyx @@ -267,7 +267,7 @@ def ensure_timedelta64ns(arr: ndarray, copy: bool=True): Parameters ---------- arr : ndarray - copy : boolean, default True + copy : bool, default True Returns ------- diff --git a/pandas/_libs/tslibs/fields.pyx b/pandas/_libs/tslibs/fields.pyx index 79d6a42075e83..d6ca38e57d2d8 100644 --- a/pandas/_libs/tslibs/fields.pyx +++ b/pandas/_libs/tslibs/fields.pyx @@ -635,9 +635,9 @@ def get_locale_names(name_type: str, locale: object = None): Parameters ---------- - name_type : string, attribute of LocaleTime() in which to return localized - names - locale : string + name_type : str + Attribute of LocaleTime() in which to return localized names. + locale : str Returns ------- diff --git a/pandas/_libs/tslibs/timedeltas.pyx b/pandas/_libs/tslibs/timedeltas.pyx index 3cdb654642b9c..bf8acfb459cb8 100644 --- a/pandas/_libs/tslibs/timedeltas.pyx +++ b/pandas/_libs/tslibs/timedeltas.pyx @@ -540,7 +540,7 @@ cdef inline int64_t timedelta_as_neg(int64_t value, bint neg): Parameters ---------- value : int64_t of the timedelta value - neg : boolean if the a negative value + neg : bool if the a negative value """ if neg: return -value diff --git a/pandas/_testing/__init__.py b/pandas/_testing/__init__.py index b38ca516c4393..adea9f6c19996 100644 --- a/pandas/_testing/__init__.py +++ b/pandas/_testing/__init__.py @@ -952,7 +952,7 @@ def get_op_from_name(op_name: str) -> Callable: Parameters ---------- - op_name : string + op_name : str The op name, in form of "add" or "__add__". Returns diff --git a/pandas/core/algorithms.py b/pandas/core/algorithms.py index f52aff424eb0b..91a7584b975c3 100644 --- a/pandas/core/algorithms.py +++ b/pandas/core/algorithms.py @@ -959,7 +959,7 @@ def mode(values, dropna: bool = True) -> Series: ---------- values : array-like Array over which to check for duplicate values. - dropna : boolean, default True + dropna : bool, default True Don't consider counts of NaN/NaT. .. versionadded:: 0.24.0 @@ -1025,9 +1025,9 @@ def rank( - ``keep``: rank each NaN value with a NaN ranking - ``top``: replace each NaN with either +/- inf so that they there are ranked at the top - ascending : boolean, default True + ascending : bool, default True Whether or not the elements should be ranked in ascending order. - pct : boolean, default False + pct : bool, default False Whether or not to the display the returned rankings in integer form (e.g. 1, 2, 3) or in percentile form (e.g. 0.333..., 0.666..., 1). """ diff --git a/pandas/core/array_algos/take.py b/pandas/core/array_algos/take.py index 8318a02d5d214..d062b39725867 100644 --- a/pandas/core/array_algos/take.py +++ b/pandas/core/array_algos/take.py @@ -76,7 +76,7 @@ def take_nd( Axis to take from fill_value : any, default np.nan Fill value to replace -1 values with - allow_fill : boolean, default True + allow_fill : bool, default True If False, indexer is assumed to contain no -1 values so no filling will be done. This short-circuits computation of a mask. Result is undefined if allow_fill == False and -1 is present in indexer. diff --git a/pandas/core/dtypes/cast.py b/pandas/core/dtypes/cast.py index 7a2175a364a8a..d4a7f8a9cd7b3 100644 --- a/pandas/core/dtypes/cast.py +++ b/pandas/core/dtypes/cast.py @@ -508,7 +508,7 @@ def maybe_upcast_putmask(result: np.ndarray, mask: np.ndarray) -> np.ndarray: result : ndarray The destination array. This will be mutated in-place if no upcasting is necessary. - mask : boolean ndarray + mask : np.ndarray[bool] Returns ------- diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 510bdfcb0079f..53e228ff704fc 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -231,7 +231,7 @@ If 0 or 'index': apply function to each column. If 1 or 'columns': apply function to each row.""", "inplace": """ - inplace : boolean, default False + inplace : bool, default False If True, performs operation inplace and returns None.""", "optional_by": """ by : str or list of str @@ -251,7 +251,7 @@ you to specify a location to update with some value.""", } -_numeric_only_doc = """numeric_only : boolean, default None +_numeric_only_doc = """numeric_only : bool or None, default None Include only float, int, boolean data. If None, will attempt to use everything, then use only numeric data """ diff --git a/pandas/core/generic.py b/pandas/core/generic.py index e47fa0eb45d94..8524907a84099 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -181,7 +181,7 @@ "axes_single_arg": "int or labels for object", "args_transpose": "axes to permute (int or label for object)", "inplace": """ - inplace : boolean, default False + inplace : bool, default False If True, performs operation inplace and returns None.""", "optional_by": """ by : str or list of str diff --git a/pandas/core/groupby/categorical.py b/pandas/core/groupby/categorical.py index c9dd420ec33df..ffe31147fe87d 100644 --- a/pandas/core/groupby/categorical.py +++ b/pandas/core/groupby/categorical.py @@ -34,9 +34,9 @@ def recode_for_groupby( Parameters ---------- c : Categorical - sort : boolean + sort : bool The value of the sort parameter groupby was called with. - observed : boolean + observed : bool Account only for the observed values Returns @@ -93,7 +93,7 @@ def recode_from_groupby( Parameters ---------- c : Categorical - sort : boolean + sort : bool The value of the sort parameter groupby was called with. ci : CategoricalIndex The codes / categories to recode diff --git a/pandas/core/groupby/grouper.py b/pandas/core/groupby/grouper.py index 51f7b44f6d69d..ae9f730ca1e97 100644 --- a/pandas/core/groupby/grouper.py +++ b/pandas/core/groupby/grouper.py @@ -293,7 +293,7 @@ def _get_grouper(self, obj, validate: bool = True): Parameters ---------- obj : the subject object - validate : boolean, default True + validate : bool, default True if True, validate the grouper Returns diff --git a/pandas/core/groupby/ops.py b/pandas/core/groupby/ops.py index 5442f90a25580..9a12766febf11 100644 --- a/pandas/core/groupby/ops.py +++ b/pandas/core/groupby/ops.py @@ -817,8 +817,8 @@ class BinGrouper(BaseGrouper): ---------- bins : the split index of binlabels to group the item of axis binlabels : the label list - filter_empty : boolean, default False - mutated : boolean, default False + filter_empty : bool, default False + mutated : bool, default False indexer : a intp array Examples diff --git a/pandas/core/indexing.py b/pandas/core/indexing.py index ae0f853db628e..7e37048c77fa5 100644 --- a/pandas/core/indexing.py +++ b/pandas/core/indexing.py @@ -2009,7 +2009,7 @@ def _align_series(self, indexer, ser: Series, multiindex_indexer: bool = False): Indexer used to get the locations that will be set to `ser`. ser : pd.Series Values to assign to the locations specified by `indexer`. - multiindex_indexer : boolean, optional + multiindex_indexer : bool, optional Defaults to False. Should be set to True if `indexer` was from a `pd.MultiIndex`, to avoid unnecessary broadcasting. diff --git a/pandas/core/missing.py b/pandas/core/missing.py index feaecec382704..53dce412f084f 100644 --- a/pandas/core/missing.py +++ b/pandas/core/missing.py @@ -789,7 +789,7 @@ def _interp_limit(invalid, fw_limit, bw_limit): Parameters ---------- - invalid : boolean ndarray + invalid : np.ndarray[bool] fw_limit : int or None forward limit to index bw_limit : int or None diff --git a/pandas/core/resample.py b/pandas/core/resample.py index abfd6932d7b21..70c9d2bc1e4e5 100644 --- a/pandas/core/resample.py +++ b/pandas/core/resample.py @@ -1272,7 +1272,7 @@ def _upsample(self, method, limit=None, fill_value=None): """ Parameters ---------- - method : string {'backfill', 'bfill', 'pad', 'ffill'} + method : {'backfill', 'bfill', 'pad', 'ffill'} Method for upsampling. limit : int, default None Maximum size gap to fill when reindexing. diff --git a/pandas/core/series.py b/pandas/core/series.py index 641a57a554a9b..4b89c09cdb898 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -162,7 +162,7 @@ "axes_single_arg": "{0 or 'index'}", "axis": """axis : {0 or 'index'} Parameter needed for compatibility with DataFrame.""", - "inplace": """inplace : boolean, default False + "inplace": """inplace : bool, default False If True, performs operation inplace and returns None.""", "unique": "np.ndarray", "duplicated": "Series", diff --git a/pandas/core/sorting.py b/pandas/core/sorting.py index 6024c083fcc6b..816c1d9195778 100644 --- a/pandas/core/sorting.py +++ b/pandas/core/sorting.py @@ -278,7 +278,7 @@ def lexsort_indexer( ---------- keys : sequence of arrays Sequence of ndarrays to be sorted by the indexer - orders : boolean or list of booleans, optional + orders : bool or list of booleans, optional Determines the sorting order for each element in keys. If a list, it must be the same length as keys. This determines whether the corresponding element in keys should be sorted in ascending diff --git a/pandas/core/tools/datetimes.py b/pandas/core/tools/datetimes.py index 5f33d00530361..66dc80159af16 100644 --- a/pandas/core/tools/datetimes.py +++ b/pandas/core/tools/datetimes.py @@ -171,7 +171,7 @@ def _maybe_cache( arg : listlike, tuple, 1-d array, Series format : string Strftime format to parse time - cache : boolean + cache : bool True attempts to create a cache of converted values convert_listlike : function Conversion function to apply on dates @@ -313,9 +313,9 @@ def _convert_listlike_datetimes( error handing behaviors from to_datetime, 'raise', 'coerce', 'ignore' infer_datetime_format : bool, default False inferring format behavior from to_datetime - dayfirst : boolean + dayfirst : bool dayfirst parsing behavior from to_datetime - yearfirst : boolean + yearfirst : bool yearfirst parsing behavior from to_datetime exact : bool, default True exact format matching behavior from to_datetime diff --git a/pandas/io/clipboards.py b/pandas/io/clipboards.py index 54cb6b9f91137..00a99eb8a4480 100644 --- a/pandas/io/clipboards.py +++ b/pandas/io/clipboards.py @@ -86,7 +86,7 @@ def to_clipboard(obj, excel=True, sep=None, **kwargs): # pragma: no cover Parameters ---------- obj : the object to write to the clipboard - excel : boolean, defaults to True + excel : bool, defaults to True if True, use the provided separator, writing in a csv format for allowing easy pasting into excel. if False, write a string representation of the object diff --git a/pandas/io/common.py b/pandas/io/common.py index b87e8fcae1064..eab13cb7cd598 100644 --- a/pandas/io/common.py +++ b/pandas/io/common.py @@ -565,9 +565,9 @@ def get_handle( Passing compression options as keys in dict is now supported for compression modes 'gzip' and 'bz2' as well as 'zip'. - memory_map : boolean, default False + memory_map : bool, default False See parsers._parser_params for more information. - is_text : boolean, default True + is_text : bool, default True Whether the type of the content passed to the file/buffer is string or bytes. This is not the same as `"b" not in mode`. If a string content is passed to a binary file/buffer, a wrapper is inserted. diff --git a/pandas/io/excel/_odfreader.py b/pandas/io/excel/_odfreader.py index 0278b22995089..567ef90802956 100644 --- a/pandas/io/excel/_odfreader.py +++ b/pandas/io/excel/_odfreader.py @@ -23,7 +23,7 @@ class ODFReader(BaseExcelReader): Parameters ---------- - filepath_or_buffer : string, path to be parsed or + filepath_or_buffer : str, path to be parsed or an open readable stream. storage_options : dict, optional passed to fsspec for appropriate URLs (see ``_get_filepath_or_buffer``) diff --git a/pandas/io/excel/_openpyxl.py b/pandas/io/excel/_openpyxl.py index 72950db72e067..20d9a998505cd 100644 --- a/pandas/io/excel/_openpyxl.py +++ b/pandas/io/excel/_openpyxl.py @@ -488,7 +488,7 @@ def __init__( Parameters ---------- - filepath_or_buffer : string, path object or Workbook + filepath_or_buffer : str, path object or Workbook Object to be parsed. storage_options : dict, optional passed to fsspec for appropriate URLs (see ``_get_filepath_or_buffer``) diff --git a/pandas/io/excel/_xlrd.py b/pandas/io/excel/_xlrd.py index 5eb88a694218a..eea0f1c03b998 100644 --- a/pandas/io/excel/_xlrd.py +++ b/pandas/io/excel/_xlrd.py @@ -15,7 +15,7 @@ def __init__(self, filepath_or_buffer, storage_options: StorageOptions = None): Parameters ---------- - filepath_or_buffer : string, path object or Workbook + filepath_or_buffer : str, path object or Workbook Object to be parsed. storage_options : dict, optional passed to fsspec for appropriate URLs (see ``_get_filepath_or_buffer``) diff --git a/pandas/io/formats/excel.py b/pandas/io/formats/excel.py index 1ec2f7bfdd4be..dbe483d021c63 100644 --- a/pandas/io/formats/excel.py +++ b/pandas/io/formats/excel.py @@ -435,18 +435,18 @@ class ExcelFormatter: Format string for floating point numbers cols : sequence, optional Columns to write - header : boolean or sequence of str, default True + header : bool or sequence of str, default True Write out column names. If a list of string is given it is assumed to be aliases for the column names - index : boolean, default True + index : bool, default True output row names (index) index_label : string or sequence, default None Column label for index column(s) if desired. If None is given, and `header` and `index` are True, then the index names are used. A sequence should be given if the DataFrame uses MultiIndex. - merge_cells : boolean, default False + merge_cells : bool, default False Format MultiIndex and Hierarchical Rows as merged cells. - inf_rep : string, default `'inf'` + inf_rep : str, default `'inf'` representation for np.inf values (which aren't representable in Excel) A `'-'` sign will be added in front of -inf. style_converter : callable, optional @@ -796,7 +796,7 @@ def write( """ writer : path-like, file-like, or ExcelWriter object File path or existing ExcelWriter - sheet_name : string, default 'Sheet1' + sheet_name : str, default 'Sheet1' Name of sheet which will contain DataFrame startrow : upper left cell row to dump data frame diff --git a/pandas/io/formats/printing.py b/pandas/io/formats/printing.py index acb17aee50b76..cbc407c2624f2 100644 --- a/pandas/io/formats/printing.py +++ b/pandas/io/formats/printing.py @@ -303,7 +303,7 @@ def format_object_summary( must be iterable and support __getitem__ formatter : callable string formatter for an element - is_justify : boolean + is_justify : bool should justify the display name : name, optional defaults to the class name of the obj diff --git a/pandas/io/formats/style.py b/pandas/io/formats/style.py index 9250d861740fc..8c72c06a96322 100644 --- a/pandas/io/formats/style.py +++ b/pandas/io/formats/style.py @@ -1280,7 +1280,7 @@ def set_table_styles( .. versionadded:: 1.2.0 - overwrite : boolean, default True + overwrite : bool, default True Styles are replaced if `True`, or extended if `False`. CSS rules are preserved so most recent styles set will dominate if selectors intersect. diff --git a/pandas/io/json/_table_schema.py b/pandas/io/json/_table_schema.py index 4824dab764259..ea47dca4f079e 100644 --- a/pandas/io/json/_table_schema.py +++ b/pandas/io/json/_table_schema.py @@ -296,7 +296,7 @@ def parse_table_schema(json, precise_float): ---------- json : A JSON table schema - precise_float : boolean + precise_float : bool Flag controlling precision when decoding string to double values, as dictated by ``read_json`` diff --git a/pandas/io/parsers/readers.py b/pandas/io/parsers/readers.py index 6adf1b20b769f..796d44dc7877a 100644 --- a/pandas/io/parsers/readers.py +++ b/pandas/io/parsers/readers.py @@ -403,7 +403,7 @@ def validate_integer(name, val, min_val=0): Parameters ---------- - name : string + name : str Parameter name (used for error reporting) val : int or float The value to check diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index 8658bb654b787..b5e7cfacc55eb 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -980,7 +980,7 @@ def select_as_multiple( columns : the columns I want back start : integer (defaults to None), row number to start selection stop : integer (defaults to None), row number to stop selection - iterator : boolean, return an iterator, default False + iterator : bool, return an iterator, default False chunksize : nrows to include in iteration, return an iterator auto_close : bool, default False Should automatically close the store when finished. @@ -1145,7 +1145,7 @@ def remove(self, key: str, where=None, start=None, stop=None): Parameters ---------- - key : string + key : str Node to remove or delete rows from where : list of Term (or convertible) objects, optional start : integer (defaults to None), row number to start selection diff --git a/pandas/io/sas/sas7bdat.py b/pandas/io/sas/sas7bdat.py index 05cc742b45d83..cd9667bb1ce4b 100644 --- a/pandas/io/sas/sas7bdat.py +++ b/pandas/io/sas/sas7bdat.py @@ -137,10 +137,10 @@ class SAS7BDATReader(ReaderBase, abc.Iterator): contents. index : column identifier, defaults to None Column to use as index. - convert_dates : boolean, defaults to True + convert_dates : bool, defaults to True Attempt to convert dates to Pandas datetime values. Note that some rarely used SAS date formats may be unsupported. - blank_missing : boolean, defaults to True + blank_missing : bool, defaults to True Convert empty strings to missing values (SAS uses blanks to indicate missing character variables). chunksize : int, defaults to None diff --git a/pandas/io/sas/sas_xport.py b/pandas/io/sas/sas_xport.py index c71de542bbf77..f7e1c56cbb196 100644 --- a/pandas/io/sas/sas_xport.py +++ b/pandas/io/sas/sas_xport.py @@ -63,23 +63,23 @@ _base_params_doc = """\ Parameters ---------- -filepath_or_buffer : string or file-like object +filepath_or_buffer : str or file-like object Path to SAS file or object implementing binary read method.""" _params2_doc = """\ index : identifier of index column Identifier of column that should be used as index of the DataFrame. -encoding : string +encoding : str Encoding for text data. chunksize : int Read file `chunksize` lines at a time, returns iterator.""" _format_params_doc = """\ -format : string +format : str File format, only `xport` is currently supported.""" _iterator_doc = """\ -iterator : boolean, default False +iterator : bool, default False Return XportReader object for reading file incrementally.""" diff --git a/pandas/io/sql.py b/pandas/io/sql.py index 200565b837dea..4b5baa0a18c90 100644 --- a/pandas/io/sql.py +++ b/pandas/io/sql.py @@ -666,7 +666,7 @@ def to_sql( - fail: If table exists, do nothing. - replace: If table exists, drop it, recreate it, and insert data. - append: If table exists, insert data. Create if does not exist. - index : boolean, default True + index : bool, default True Write DataFrame index as a column. index_label : str or sequence, optional Column label for index column(s). If None is given (default) and @@ -1341,11 +1341,11 @@ def read_table( Parameters ---------- - table_name : string + table_name : str Name of SQL table in database. index_col : string, optional, default: None Column to set as index. - 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. This can result in loss of precision. @@ -1436,11 +1436,11 @@ def read_query( Parameters ---------- - sql : string + sql : str SQL query to be executed. index_col : string, optional, default: None Column name to use as index for the returned DataFrame object. - coerce_float : boolean, default True + coerce_float : bool, default True Attempt 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 @@ -1530,7 +1530,7 @@ def to_sql( - fail: If table exists, do nothing. - replace: If table exists, drop it, recreate it, and insert data. - append: If table exists, insert data. Create if does not exist. - index : boolean, default True + index : bool, default True Write DataFrame index as a column. index_label : string or sequence, default None Column label for index column(s). If None is given (default) and @@ -2028,7 +2028,7 @@ def to_sql( fail: If table exists, do nothing. replace: If table exists, drop it, recreate it, and insert data. append: If table exists, insert data. Create if it does not exist. - index : boolean, default True + index : bool, default True Write DataFrame index as a column index_label : string or sequence, default None Column label for index column(s). If None is given (default) and @@ -2135,7 +2135,7 @@ def get_schema( Parameters ---------- frame : DataFrame - name : string + name : str name of SQL table keys : string or sequence, default: None columns to use a primary key diff --git a/pandas/plotting/_matplotlib/converter.py b/pandas/plotting/_matplotlib/converter.py index 677c3e791c72b..7c6a718b34e89 100644 --- a/pandas/plotting/_matplotlib/converter.py +++ b/pandas/plotting/_matplotlib/converter.py @@ -506,7 +506,7 @@ def period_break(dates: PeriodIndex, period: str) -> np.ndarray: ---------- dates : PeriodIndex Array of intervals to monitor. - period : string + period : str Name of the period to monitor. """ current = getattr(dates, period) diff --git a/pandas/tests/frame/test_reductions.py b/pandas/tests/frame/test_reductions.py index 616405c01cc2a..1304e861f948e 100644 --- a/pandas/tests/frame/test_reductions.py +++ b/pandas/tests/frame/test_reductions.py @@ -43,7 +43,7 @@ def assert_stat_op_calc( Parameters ---------- - opname : string + opname : str Name of the operator to test on frame alternative : function Function that opname is tested against; i.e. "frame.opname()" should @@ -146,7 +146,7 @@ def assert_stat_op_api(opname, float_frame, float_string_frame, has_numeric_only Parameters ---------- - opname : string + opname : str Name of the operator to test on frame float_frame : DataFrame DataFrame with columns of type float @@ -172,7 +172,7 @@ def assert_bool_op_calc(opname, alternative, frame, has_skipna=True): Parameters ---------- - opname : string + opname : str Name of the operator to test on frame alternative : function Function that opname is tested against; i.e. "frame.opname()" should @@ -237,7 +237,7 @@ def assert_bool_op_api( Parameters ---------- - opname : string + opname : str Name of the operator to test on frame float_frame : DataFrame DataFrame with columns of type float diff --git a/pandas/tseries/frequencies.py b/pandas/tseries/frequencies.py index ea60bc7f91a36..05b8885b7d9b7 100644 --- a/pandas/tseries/frequencies.py +++ b/pandas/tseries/frequencies.py @@ -564,7 +564,7 @@ def _maybe_coerce_freq(code) -> str: Parameters ---------- - source : string or DateOffset + source : str or DateOffset Frequency converting from Returns