Skip to content

Commit 4195bfb

Browse files
CLN: Fix common spelling mistakes (#32895)
1 parent 447a595 commit 4195bfb

Some content is hidden

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

46 files changed

+60
-62
lines changed

asv_bench/benchmarks/rolling.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Methods:
1111
["int", "float"],
1212
["median", "mean", "max", "min", "std", "count", "skew", "kurt", "sum"],
1313
)
14-
param_names = ["contructor", "window", "dtype", "method"]
14+
param_names = ["constructor", "window", "dtype", "method"]
1515

1616
def setup(self, constructor, window, dtype, method):
1717
N = 10 ** 5
@@ -72,7 +72,7 @@ class ExpandingMethods:
7272
["int", "float"],
7373
["median", "mean", "max", "min", "std", "count", "skew", "kurt", "sum"],
7474
)
75-
param_names = ["contructor", "window", "dtype", "method"]
75+
param_names = ["constructor", "window", "dtype", "method"]
7676

7777
def setup(self, constructor, dtype, method):
7878
N = 10 ** 5
@@ -86,7 +86,7 @@ def time_expanding(self, constructor, dtype, method):
8686
class EWMMethods:
8787

8888
params = (["DataFrame", "Series"], [10, 1000], ["int", "float"], ["mean", "std"])
89-
param_names = ["contructor", "window", "dtype", "method"]
89+
param_names = ["constructor", "window", "dtype", "method"]
9090

9191
def setup(self, constructor, window, dtype, method):
9292
N = 10 ** 5
@@ -104,7 +104,7 @@ class VariableWindowMethods(Methods):
104104
["int", "float"],
105105
["median", "mean", "max", "min", "std", "count", "skew", "kurt", "sum"],
106106
)
107-
param_names = ["contructor", "window", "dtype", "method"]
107+
param_names = ["constructor", "window", "dtype", "method"]
108108

109109
def setup(self, constructor, window, dtype, method):
110110
N = 10 ** 5

ci/azure/posix.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
ENV_FILE: ci/deps/azure-36-locale_slow.yaml
2525
CONDA_PY: "36"
2626
PATTERN: "slow"
27-
# pandas does not use the language (zh_CN), but should support diferent encodings (utf8)
27+
# pandas does not use the language (zh_CN), but should support different encodings (utf8)
2828
# we should test with encodings different than utf8, but doesn't seem like Ubuntu supports any
2929
LANG: "zh_CN.utf8"
3030
LC_ALL: "zh_CN.utf8"

doc/source/getting_started/intro_tutorials/02_read_write.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ The method :meth:`~DataFrame.info` provides technical information about a
225225
<div class="d-flex flex-row bg-light gs-torefguide">
226226
<span class="badge badge-info">To user guide</span>
227227

228-
For a complete overview of the input and output possibilites from and to pandas, see the user guide section about :ref:`reader and writer functions <io>`.
228+
For a complete overview of the input and output possibilities from and to pandas, see the user guide section about :ref:`reader and writer functions <io>`.
229229

230230
.. raw:: html
231231

doc/source/getting_started/intro_tutorials/03_subset_data.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ And have a look at the ``shape`` of the output:
101101
102102
titanic["Age"].shape
103103
104-
:attr:`DataFrame.shape` is an attribute (remember :ref:`tutorial on reading and writing <10min_tut_02_read_write>`, do not use parantheses for attributes) of a
104+
:attr:`DataFrame.shape` is an attribute (remember :ref:`tutorial on reading and writing <10min_tut_02_read_write>`, do not use parentheses for attributes) of a
105105
pandas ``Series`` and ``DataFrame`` containing the number of rows and
106106
columns: *(nrows, ncolumns)*. A pandas Series is 1-dimensional and only
107107
the number of rows is returned.

doc/source/getting_started/intro_tutorials/08_combine_dataframes.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ index. For example:
165165
.. note::
166166
The existence of multiple row/column indices at the same time
167167
has not been mentioned within these tutorials. *Hierarchical indexing*
168-
or *MultiIndex* is an advanced and powerfull pandas feature to analyze
168+
or *MultiIndex* is an advanced and powerful pandas feature to analyze
169169
higher dimensional data.
170170

171171
Multi-indexing is out of scope for this pandas introduction. For the

doc/source/getting_started/intro_tutorials/10_text_data.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ Which passenger of the titanic has the longest name?
188188
189189
titanic["Name"].str.len()
190190
191-
To get the longest name we first have to get the lenghts of each of the
191+
To get the longest name we first have to get the lengths of each of the
192192
names in the ``Name`` column. By using pandas string methods, the
193193
:meth:`Series.str.len` function is applied to each of the names individually
194194
(element-wise).

doc/source/user_guide/dsintro.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ From a list of dataclasses
406406

407407
Data Classes as introduced in `PEP557 <https://www.python.org/dev/peps/pep-0557>`__,
408408
can be passed into the DataFrame constructor.
409-
Passing a list of dataclasses is equivilent to passing a list of dictionaries.
409+
Passing a list of dataclasses is equivalent to passing a list of dictionaries.
410410

411411
Please be aware, that that all values in the list should be dataclasses, mixing
412412
types in the list would result in a TypeError.

doc/source/user_guide/indexing.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ For getting values with a boolean array:
374374
df1.loc['a'] > 0
375375
df1.loc[:, df1.loc['a'] > 0]
376376
377-
NA values in a boolean array propogate as ``False``:
377+
NA values in a boolean array propagate as ``False``:
378378

379379
.. versionchanged:: 1.0.2
380380

doc/source/user_guide/io.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -5005,7 +5005,7 @@ Possible values are:
50055005
This usually provides better performance for analytic databases
50065006
like *Presto* and *Redshift*, but has worse performance for
50075007
traditional SQL backend if the table contains many columns.
5008-
For more information check the SQLAlchemy `documention
5008+
For more information check the SQLAlchemy `documentation
50095009
<https://docs.sqlalchemy.org/en/latest/core/dml.html#sqlalchemy.sql.expression.Insert.values.params.*args>`__.
50105010
- callable with signature ``(pd_table, conn, keys, data_iter)``:
50115011
This can be used to implement a more performant insertion method based on

doc/source/user_guide/scale.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ Inspecting the ``ddf`` object, we see a few things
259259
* There are familiar methods like ``.groupby``, ``.sum``, etc.
260260
* There are new attributes like ``.npartitions`` and ``.divisions``
261261

262-
The partitions and divisions are how Dask parallizes computation. A **Dask**
262+
The partitions and divisions are how Dask parallelizes computation. A **Dask**
263263
DataFrame is made up of many **Pandas** DataFrames. A single method call on a
264264
Dask DataFrame ends up making many pandas method calls, and Dask knows how to
265265
coordinate everything to get the result.

doc/source/user_guide/style.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -620,8 +620,8 @@
620620
"aligns = ['left','zero','mid']\n",
621621
"for align in aligns:\n",
622622
" row = \"<tr><th>{}</th>\".format(align)\n",
623-
" for serie in [test1,test2,test3]:\n",
624-
" s = serie.copy()\n",
623+
" for series in [test1,test2,test3]:\n",
624+
" s = series.copy()\n",
625625
" s.name=''\n",
626626
" row += \"<td>{}</td>\".format(s.to_frame().style.bar(align=align, \n",
627627
" color=['#d65f5f', '#5fba7d'], \n",

doc/source/whatsnew/v0.24.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ Other enhancements
397397
- :func:`~DataFrame.to_csv`, :func:`~Series.to_csv`, :func:`~DataFrame.to_json`, and :func:`~Series.to_json` now support ``compression='infer'`` to infer compression based on filename extension (:issue:`15008`).
398398
The default compression for ``to_csv``, ``to_json``, and ``to_pickle`` methods has been updated to ``'infer'`` (:issue:`22004`).
399399
- :meth:`DataFrame.to_sql` now supports writing ``TIMESTAMP WITH TIME ZONE`` types for supported databases. For databases that don't support timezones, datetime data will be stored as timezone unaware local timestamps. See the :ref:`io.sql_datetime_data` for implications (:issue:`9086`).
400-
- :func:`to_timedelta` now supports iso-formated timedelta strings (:issue:`21877`)
400+
- :func:`to_timedelta` now supports iso-formatted timedelta strings (:issue:`21877`)
401401
- :class:`Series` and :class:`DataFrame` now support :class:`Iterable` objects in the constructor (:issue:`2193`)
402402
- :class:`DatetimeIndex` has gained the :attr:`DatetimeIndex.timetz` attribute. This returns the local time with timezone information. (:issue:`21358`)
403403
- :meth:`~Timestamp.round`, :meth:`~Timestamp.ceil`, and :meth:`~Timestamp.floor` for :class:`DatetimeIndex` and :class:`Timestamp`

doc/source/whatsnew/v1.0.1.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Fixed regressions
1616
~~~~~~~~~~~~~~~~~
1717

1818
- Fixed regression in :class:`DataFrame` setting values with a slice (e.g. ``df[-4:] = 1``) indexing by label instead of position (:issue:`31469`)
19-
- Fixed regression when indexing a ``Series`` or ``DataFrame`` indexed by ``DatetimeIndex`` with a slice containg a :class:`datetime.date` (:issue:`31501`)
19+
- Fixed regression when indexing a ``Series`` or ``DataFrame`` indexed by ``DatetimeIndex`` with a slice containing a :class:`datetime.date` (:issue:`31501`)
2020
- Fixed regression in ``DataFrame.__setitem__`` raising an ``AttributeError`` with a :class:`MultiIndex` and a non-monotonic indexer (:issue:`31449`)
2121
- Fixed regression in :class:`Series` multiplication when multiplying a numeric :class:`Series` with >10000 elements with a timedelta-like scalar (:issue:`31457`)
2222
- Fixed regression in ``.groupby().agg()`` raising an ``AssertionError`` for some reductions like ``min`` on object-dtype columns (:issue:`31522`)

doc/source/whatsnew/v1.1.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ MultiIndex
335335

336336
I/O
337337
^^^
338-
- Bug in :meth:`read_json` where integer overflow was occuring when json contains big number strings. (:issue:`30320`)
338+
- Bug in :meth:`read_json` where integer overflow was occurring when json contains big number strings. (:issue:`30320`)
339339
- `read_csv` will now raise a ``ValueError`` when the arguments `header` and `prefix` both are not `None`. (:issue:`27394`)
340340
- Bug in :meth:`DataFrame.to_json` was raising ``NotFoundError`` when ``path_or_buf`` was an S3 URI (:issue:`28375`)
341341
- Bug in :meth:`DataFrame.to_parquet` overwriting pyarrow's default for

pandas/_libs/hashtable_class_helper.pxi.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ cdef class StringHashTable(HashTable):
674674
val = values[i]
675675

676676
if isinstance(val, str):
677-
# GH#31499 if we have a np.str_ get_c_string wont recognize
677+
# GH#31499 if we have a np.str_ get_c_string won't recognize
678678
# it as a str, even though isinstance does.
679679
v = get_c_string(<str>val)
680680
else:
@@ -709,7 +709,7 @@ cdef class StringHashTable(HashTable):
709709
val = values[i]
710710

711711
if isinstance(val, str):
712-
# GH#31499 if we have a np.str_ get_c_string wont recognize
712+
# GH#31499 if we have a np.str_ get_c_string won't recognize
713713
# it as a str, even though isinstance does.
714714
v = get_c_string(<str>val)
715715
else:

pandas/_libs/lib.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2059,7 +2059,7 @@ def maybe_convert_objects(ndarray[object] objects, bint try_float=0,
20592059
If an array-like object contains only timedelta values or NaT is
20602060
encountered, whether to convert and return an array of m8[ns] dtype.
20612061
convert_to_nullable_integer : bool, default False
2062-
If an array-like object contains only interger values (and NaN) is
2062+
If an array-like object contains only integer values (and NaN) is
20632063
encountered, whether to convert and return an IntegerArray.
20642064
20652065
Returns

pandas/_libs/tslibs/offsets.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ class _BaseOffset:
520520
state = self.__dict__.copy()
521521

522522
# we don't want to actually pickle the calendar object
523-
# as its a np.busyday; we recreate on deserilization
523+
# as its a np.busyday; we recreate on deserialization
524524
if 'calendar' in state:
525525
del state['calendar']
526526
try:

pandas/_libs/tslibs/parsing.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ cpdef bint _does_string_look_like_datetime(str py_string):
349349
elif py_string in _not_datelike_strings:
350350
return False
351351
else:
352-
# xstrtod with such paramaters copies behavior of python `float`
352+
# xstrtod with such parameters copies behavior of python `float`
353353
# cast; for example, " 35.e-1 " is valid string for this cast so,
354354
# for correctly xstrtod call necessary to pass these params:
355355
# b'.' - a dot is used as separator, b'e' - an exponential form of

pandas/_testing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2206,7 +2206,7 @@ def network(
22062206
22072207
Notes
22082208
-----
2209-
* ``raise_on_error`` supercedes ``check_before_test``
2209+
* ``raise_on_error`` supersedes ``check_before_test``
22102210
22112211
Returns
22122212
-------

pandas/core/arrays/datetimelike.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def _check_compatible_with(
202202
----------
203203
other
204204
setitem : bool, default False
205-
For __setitem__ we may have stricter compatiblity resrictions than
205+
For __setitem__ we may have stricter compatibility resrictions than
206206
for comparisons.
207207
208208
Raises
@@ -1167,7 +1167,7 @@ def _add_timedelta_arraylike(self, other):
11671167
-------
11681168
Same type as self
11691169
"""
1170-
# overriden by PeriodArray
1170+
# overridden by PeriodArray
11711171

11721172
if len(self) != len(other):
11731173
raise ValueError("cannot add indices of unequal length")

pandas/core/arrays/string_.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def value_counts(self, dropna=False):
281281

282282
return value_counts(self._ndarray, dropna=dropna).astype("Int64")
283283

284-
# Overrride parent because we have different return types.
284+
# Override parent because we have different return types.
285285
@classmethod
286286
def _create_arithmetic_method(cls, op):
287287
# Note: this handles both arithmetic and comparison methods.

pandas/core/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ def _aggregate_multiple_funcs(self, arg, _axis):
531531
# raised directly in _aggregate_named
532532
pass
533533
elif "no results" in str(err):
534-
# raised direcly in _aggregate_multiple_funcs
534+
# raised directly in _aggregate_multiple_funcs
535535
pass
536536
else:
537537
raise

pandas/core/computation/parsing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def clean_column_name(name: str) -> str:
116116
117117
If this name was used in the query string (this makes the query call impossible)
118118
an error will be raised by :func:`tokenize_backtick_quoted_string` instead,
119-
which is not catched and propogates to the user level.
119+
which is not caught and propagates to the user level.
120120
"""
121121
try:
122122
tokenized = tokenize_string(f"`{name}`")

pandas/core/frame.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1065,7 +1065,7 @@ def dot(self, other):
10651065
-------
10661066
Series or DataFrame
10671067
If other is a Series, return the matrix product between self and
1068-
other as a Serie. If other is a DataFrame or a numpy.array, return
1068+
other as a Series. If other is a DataFrame or a numpy.array, return
10691069
the matrix product of self and other in a DataFrame of a np.array.
10701070
10711071
See Also

pandas/core/generic.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -8051,7 +8051,7 @@ def first(self: FrameOrSeries, offset) -> FrameOrSeries:
80518051
2018-04-09 1
80528052
2018-04-11 2
80538053
8054-
Notice the data for 3 first calender days were returned, not the first
8054+
Notice the data for 3 first calendar days were returned, not the first
80558055
3 days observed in the dataset, and therefore data for 2018-04-13 was
80568056
not returned.
80578057
"""
@@ -8113,7 +8113,7 @@ def last(self: FrameOrSeries, offset) -> FrameOrSeries:
81138113
2018-04-13 3
81148114
2018-04-15 4
81158115
8116-
Notice the data for 3 last calender days were returned, not the last
8116+
Notice the data for 3 last calendar days were returned, not the last
81178117
3 observed days in the dataset, and therefore data for 2018-04-11 was
81188118
not returned.
81198119
"""

pandas/core/indexes/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5145,7 +5145,7 @@ def insert(self, loc: int, item):
51455145
-------
51465146
new_index : Index
51475147
"""
5148-
# Note: this method is overriden by all ExtensionIndex subclasses,
5148+
# Note: this method is overridden by all ExtensionIndex subclasses,
51495149
# so self is never backed by an EA.
51505150
arr = np.asarray(self)
51515151
item = self._coerce_scalar_to_index(item)._values

pandas/core/indexes/interval.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ def memory_usage(self, deep: bool = False) -> int:
426426
return self.left.memory_usage(deep=deep) + self.right.memory_usage(deep=deep)
427427

428428
# IntervalTree doesn't have a is_monotonic_decreasing, so have to override
429-
# the Index implemenation
429+
# the Index implementation
430430
@cache_readonly
431431
def is_monotonic_decreasing(self) -> bool:
432432
"""

pandas/core/indexes/multi.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3314,7 +3314,7 @@ def intersection(self, other, sort=False):
33143314
lvals = self._values
33153315
rvals = other._values
33163316

3317-
uniq_tuples = None # flag whether _inner_indexer was succesful
3317+
uniq_tuples = None # flag whether _inner_indexer was successful
33183318
if self.is_monotonic and other.is_monotonic:
33193319
try:
33203320
uniq_tuples = self._inner_indexer(lvals, rvals)[0]

pandas/core/nanops.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1313,7 +1313,7 @@ def get_corr_func(method):
13131313
return method
13141314
else:
13151315
raise ValueError(
1316-
f"Unkown method '{method}', expected one of 'kendall', 'spearman'"
1316+
f"Unknown method '{method}', expected one of 'kendall', 'spearman'"
13171317
)
13181318

13191319
def _pearson(a, b):
@@ -1509,7 +1509,7 @@ def na_accum_func(values: ArrayLike, accum_func, skipna: bool) -> ArrayLike:
15091509
Parameters
15101510
----------
15111511
values : np.ndarray or ExtensionArray
1512-
accum_func : {np.cumprod, np.maximum.accumulate, np.cumsum, np.minumum.accumulate}
1512+
accum_func : {np.cumprod, np.maximum.accumulate, np.cumsum, np.minimum.accumulate}
15131513
skipna : bool
15141514
15151515
Returns

pandas/core/series.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,7 @@ def __getitem__(self, key):
910910
def _get_with(self, key):
911911
# other: fancy integer or otherwise
912912
if isinstance(key, slice):
913-
# _convert_slice_indexer to determing if this slice is positional
913+
# _convert_slice_indexer to determin if this slice is positional
914914
# or label based, and if the latter, convert to positional
915915
slobj = self.index._convert_slice_indexer(key, kind="getitem")
916916
return self._slice(slobj)
@@ -3958,7 +3958,7 @@ def rename(
39583958
Parameters
39593959
----------
39603960
axis : {0 or "index"}
3961-
Unused. Accepted for compatability with DataFrame method only.
3961+
Unused. Accepted for compatibility with DataFrame method only.
39623962
index : scalar, hashable sequence, dict-like or function, optional
39633963
Functions or dict-like are transformations to apply to
39643964
the index.

pandas/core/strings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2498,7 +2498,7 @@ def cat(self, others=None, sep=None, na_rep=None, join="left"):
24982498
Limit number of splits in output.
24992499
``None``, 0 and -1 will be interpreted as return all splits.
25002500
expand : bool, default False
2501-
Expand the splitted strings into separate columns.
2501+
Expand the split strings into separate columns.
25022502
25032503
* If ``True``, return DataFrame/MultiIndex expanding dimensionality.
25042504
* If ``False``, return Series/Index, containing lists of strings.

pandas/core/window/rolling.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def _dir_additions(self):
196196

197197
def _get_win_type(self, kwargs: Dict):
198198
"""
199-
Exists for compatibility, overriden by subclass Window.
199+
Exists for compatibility, overridden by subclass Window.
200200
201201
Parameters
202202
----------

pandas/io/formats/html.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def write_th(
101101
self, s: Any, header: bool = False, indent: int = 0, tags: Optional[str] = None
102102
) -> None:
103103
"""
104-
Method for writting a formatted <th> cell.
104+
Method for writing a formatted <th> cell.
105105
106106
If col_space is set on the formatter then that is used for
107107
the value of min-width.

pandas/io/pytables.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4682,7 +4682,7 @@ def _convert_index(name: str, index: Index, encoding: str, errors: str) -> Index
46824682
raise TypeError("MultiIndex not supported here!")
46834683

46844684
inferred_type = lib.infer_dtype(index, skipna=False)
4685-
# we wont get inferred_type of "datetime64" or "timedelta64" as these
4685+
# we won't get inferred_type of "datetime64" or "timedelta64" as these
46864686
# would go through the DatetimeIndex/TimedeltaIndex paths above
46874687

46884688
values = np.asarray(index)

pandas/tests/arithmetic/test_interval.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def interval_constructor(self, request):
100100

101101
def elementwise_comparison(self, op, array, other):
102102
"""
103-
Helper that performs elementwise comparisions between `array` and `other`
103+
Helper that performs elementwise comparisons between `array` and `other`
104104
"""
105105
other = other if is_list_like(other) else [other] * len(array)
106106
return np.array([op(x, y) for x, y in zip(array, other)])

0 commit comments

Comments
 (0)