Skip to content

Commit 6388370

Browse files
authored
CLN: spelling fixes in docstrings (#34039)
* spelling fixes * add whatsnew entry * fix doctests * and one more that wasn't caught
1 parent 3ed7dff commit 6388370

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+81
-82
lines changed

pandas/core/aggregation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def normalize_keyword_aggregation(kwargs: dict) -> Tuple[dict, List[str], List[i
8989
]
9090
uniquified_aggspec = _make_unique_kwarg_list(aggspec_order)
9191

92-
# get the new indice of columns by comparison
92+
# get the new index of columns by comparison
9393
col_idx_order = Index(uniquified_aggspec).get_indexer(uniquified_order)
9494
return aggspec, columns, col_idx_order
9595

@@ -182,7 +182,7 @@ def maybe_mangle_lambdas(agg_spec: Any) -> Any:
182182
is_dict = is_dict_like(agg_spec)
183183
if not (is_dict or is_list_like(agg_spec)):
184184
return agg_spec
185-
mangled_aggspec = type(agg_spec)() # dict or OrderdDict
185+
mangled_aggspec = type(agg_spec)() # dict or OrderedDict
186186

187187
if is_dict:
188188
for key, aggfuncs in agg_spec.items():

pandas/core/algorithms.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def _ensure_data(
125125

126126
except (TypeError, ValueError, OverflowError):
127127
# if we are trying to coerce to a dtype
128-
# and it is incompat this will fall through to here
128+
# and it is incompatible this will fall through to here
129129
return ensure_object(values), np.dtype("object")
130130

131131
# datetimelike
@@ -473,7 +473,7 @@ def _factorize_array(
473473
values : ndarray
474474
na_sentinel : int, default -1
475475
size_hint : int, optional
476-
Passsed through to the hashtable's 'get_labels' method
476+
Passed through to the hashtable's 'get_labels' method
477477
na_value : object, optional
478478
A value in `values` to consider missing. Note: only use this
479479
parameter when you know that you don't have any values pandas would
@@ -1239,7 +1239,7 @@ def get_indexer(current_indexer, other_indexer):
12391239
break
12401240

12411241
# Now find all values which are equal to
1242-
# the (nsmallest: largest)/(nlarrgest: smallest)
1242+
# the (nsmallest: largest)/(nlargest: smallest)
12431243
# from our series.
12441244
border_value = values == values[values.index[-1]]
12451245

pandas/core/arrays/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ def _values_for_factorize(self) -> Tuple[np.ndarray, Any]:
696696
na_value : object
697697
The value in `values` to consider missing. This will be treated
698698
as NA in the factorization routines, so it will be coded as
699-
`na_sentinal` and not included in `uniques`. By default,
699+
`na_sentinel` and not included in `uniques`. By default,
700700
``np.nan`` is used.
701701
702702
Notes

pandas/core/arrays/categorical.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2015,7 +2015,7 @@ def __setitem__(self, key, value):
20152015
# tuple of indexers (dataframe)
20162016
elif isinstance(key, tuple):
20172017
# only allow 1 dimensional slicing, but can
2018-
# in a 2-d case be passd (slice(None),....)
2018+
# in a 2-d case be passed (slice(None),....)
20192019
if len(key) == 2:
20202020
if not com.is_null_slice(key[0]):
20212021
raise AssertionError("invalid slicing for a 1-ndim categorical")

pandas/core/arrays/datetimelike.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def _check_compatible_with(
198198
----------
199199
other
200200
setitem : bool, default False
201-
For __setitem__ we may have stricter compatibility resrictions than
201+
For __setitem__ we may have stricter compatibility restrictions than
202202
for comparisons.
203203
204204
Raises

pandas/core/arrays/period.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def __array__(self, dtype=None) -> np.ndarray:
284284
elif dtype == bool:
285285
return ~self._isnan
286286

287-
# This will raise TypeErorr for non-object dtypes
287+
# This will raise TypeError for non-object dtypes
288288
return np.array(list(self), dtype=object)
289289

290290
def __arrow_array__(self, type=None):

pandas/core/arrays/sparse/array.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ def __getitem__(self, key):
784784
# TODO: I think we can avoid densifying when masking a
785785
# boolean SparseArray with another. Need to look at the
786786
# key's fill_value for True / False, and then do an intersection
787-
# on the indicies of the sp_values.
787+
# on the indices of the sp_values.
788788
if isinstance(key, SparseArray):
789789
if is_bool_dtype(key):
790790
key = key.to_dense()

pandas/core/arrays/timedeltas.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ def _generate_range(cls, start, end, periods, freq, closed=None):
258258
if start is None and end is None:
259259
if closed is not None:
260260
raise ValueError(
261-
"Closed has to be None if not both of startand end are defined"
261+
"Closed has to be None if not both of start and end are defined"
262262
)
263263

264264
left_closed, right_closed = dtl.validate_endpoints(closed)
@@ -877,7 +877,7 @@ def sequence_to_td64ns(data, copy=False, unit="ns", errors="raise"):
877877
"""
878878
Parameters
879879
----------
880-
array : list-like
880+
data : list-like
881881
copy : bool, default False
882882
unit : str, default "ns"
883883
The timedelta unit to treat integers as multiples of.
@@ -930,7 +930,7 @@ def sequence_to_td64ns(data, copy=False, unit="ns", errors="raise"):
930930
copy = copy and not copy_made
931931

932932
elif is_float_dtype(data.dtype):
933-
# cast the unit, multiply base/frace separately
933+
# cast the unit, multiply base/frac separately
934934
# to avoid precision issues from float -> int
935935
mask = np.isnan(data)
936936
m, p = precision_from_unit(unit)

pandas/core/config_init.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ def use_inf_as_na_cb(key):
604604
: str
605605
The plotting backend to use. The default value is "matplotlib", the
606606
backend provided with pandas. Other backends can be specified by
607-
prodiving the name of the module that implements the backend.
607+
providing the name of the module that implements the backend.
608608
"""
609609

610610

pandas/core/construction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ def _try_cast(
543543
return subarr
544544

545545
try:
546-
# GH#15832: Check if we are requesting a numeric dype and
546+
# GH#15832: Check if we are requesting a numeric dtype and
547547
# that we can convert the data to the requested dtype.
548548
if is_integer_dtype(dtype):
549549
# this will raise if we have e.g. floats

0 commit comments

Comments
 (0)