Skip to content

Commit 5593886

Browse files
authored
fix typos (#59665)
typos
1 parent 952cbb6 commit 5593886

Some content is hidden

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

50 files changed

+65
-65
lines changed

asv_bench/benchmarks/indexing_engines.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def setup(self, engine_and_dtype, index_type, unique, N):
8787
arr = np.array([1, 2, 3], dtype=dtype).repeat(N)
8888

8989
self.data = engine(arr)
90-
# code belows avoids populating the mapping etc. while timing.
90+
# code below avoids populating the mapping etc. while timing.
9191
self.data.get_loc(2)
9292

9393
self.key_middle = arr[len(arr) // 2]
@@ -140,7 +140,7 @@ def setup(self, engine_and_dtype, index_type, unique, N):
140140
mask[-1] = True
141141

142142
self.data = engine(BaseMaskedArray(arr, mask))
143-
# code belows avoids populating the mapping etc. while timing.
143+
# code below avoids populating the mapping etc. while timing.
144144
self.data.get_loc(2)
145145

146146
self.key_middle = arr[len(arr) // 2]
@@ -169,7 +169,7 @@ def setup(self, index_type):
169169
}[index_type]
170170

171171
self.data = libindex.ObjectEngine(arr)
172-
# code belows avoids populating the mapping etc. while timing.
172+
# code below avoids populating the mapping etc. while timing.
173173
self.data.get_loc("b")
174174

175175
def time_get_loc(self, index_type):

doc/source/development/contributing_codebase.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ The ``temp_file`` pytest fixture creates a temporary file :py:class:`Pathlib` ob
605605
pd.DataFrame([1]).to_csv(str(temp_file))
606606
607607
Please reference `pytest's documentation <https://docs.pytest.org/en/latest/how-to/tmp_path.html#the-default-base-temporary-directory>`_
608-
for the file retension policy.
608+
for the file retention policy.
609609

610610
Testing involving network connectivity
611611
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

doc/source/development/debugging_extensions.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ By specifying ``builddir="debug"`` all of the targets will be built and placed i
3030
Using Docker
3131
------------
3232

33-
To simplify the debugging process, pandas has created a Docker image with a debug build of Python and the gdb/Cython debuggers pre-installed. You may either ``docker pull pandas/pandas-debug`` to get access to this image or build it from the ``tooling/debug`` folder locallly.
33+
To simplify the debugging process, pandas has created a Docker image with a debug build of Python and the gdb/Cython debuggers pre-installed. You may either ``docker pull pandas/pandas-debug`` to get access to this image or build it from the ``tooling/debug`` folder locally.
3434

3535
You can then mount your pandas repository into this image via:
3636

doc/source/getting_started/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ the pandas-equivalent operations compared to software you already know:
613613

614614
Users of `Excel <https://en.wikipedia.org/wiki/Microsoft_Excel>`__
615615
or other spreadsheet programs will find that many of the concepts are
616-
transferrable to pandas.
616+
transferable to pandas.
617617

618618
+++
619619

doc/source/user_guide/cookbook.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ Using TimeGrouper and another grouping to create subgroups, then apply a custom
914914
<https://stackoverflow.com/questions/15408156/resampling-with-custom-periods>`__
915915

916916
`Resample intraday frame without adding new days
917-
<https://stackoverflow.com/questions/14898574/resample-intrday-pandas-dataframe-without-add-new-days>`__
917+
<https://stackoverflow.com/questions/14898574/resample-intraday-pandas-dataframe-without-add-new-days>`__
918918

919919
`Resample minute data
920920
<https://stackoverflow.com/questions/14861023/resampling-minute-data>`__

doc/source/user_guide/io.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ dtype_backend : {"numpy_nullable", "pyarrow"}, defaults to NumPy backed DataFram
169169
implementation when "numpy_nullable" is set, pyarrow is used for all
170170
dtypes if "pyarrow" is set.
171171

172-
The dtype_backends are still experimential.
172+
The dtype_backends are still experiential.
173173

174174
.. versionadded:: 2.0
175175

@@ -2893,7 +2893,7 @@ Read in the content of the "books.xml" as instance of ``StringIO`` or
28932893
df
28942894
28952895
Even read XML from AWS S3 buckets such as NIH NCBI PMC Article Datasets providing
2896-
Biomedical and Life Science Jorurnals:
2896+
Biomedical and Life Science Journals:
28972897

28982898
.. code-block:: python
28992899

doc/source/user_guide/style.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,7 @@
11821182
"Some styling functions are common enough that we've \"built them in\" to the `Styler`, so you don't have to write them and apply them yourself. The current list of such functions is:\n",
11831183
"\n",
11841184
" - [.highlight_null][nullfunc]: for use with identifying missing data. \n",
1185-
" - [.highlight_min][minfunc] and [.highlight_max][maxfunc]: for use with identifying extremeties in data.\n",
1185+
" - [.highlight_min][minfunc] and [.highlight_max][maxfunc]: for use with identifying extremities in data.\n",
11861186
" - [.highlight_between][betweenfunc] and [.highlight_quantile][quantilefunc]: for use with identifying classes within data.\n",
11871187
" - [.background_gradient][bgfunc]: a flexible method for highlighting cells based on their, or other, values on a numeric scale.\n",
11881188
" - [.text_gradient][textfunc]: similar method for highlighting text based on their, or other, values on a numeric scale.\n",

doc/source/whatsnew/v0.21.1.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ IO
141141
Plotting
142142
^^^^^^^^
143143

144-
- Bug in ``DataFrame.plot()`` and ``Series.plot()`` with :class:`DatetimeIndex` where a figure generated by them is not pickleable in Python 3 (:issue:`18439`)
144+
- Bug in ``DataFrame.plot()`` and ``Series.plot()`` with :class:`DatetimeIndex` where a figure generated by them is not picklable in Python 3 (:issue:`18439`)
145145

146146
GroupBy/resample/rolling
147147
^^^^^^^^^^^^^^^^^^^^^^^^

doc/source/whatsnew/v0.25.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1159,7 +1159,7 @@ IO
11591159
- Bug in :meth:`DataFrame.to_html` where header numbers would ignore display options when rounding (:issue:`17280`)
11601160
- Bug in :func:`read_hdf` where reading a table from an HDF5 file written directly with PyTables fails with a ``ValueError`` when using a sub-selection via the ``start`` or ``stop`` arguments (:issue:`11188`)
11611161
- Bug in :func:`read_hdf` not properly closing store after a ``KeyError`` is raised (:issue:`25766`)
1162-
- Improved the explanation for the failure when value labels are repeated in Stata dta files and suggested work-arounds (:issue:`25772`)
1162+
- Improved the explanation for the failure when value labels are repeated in Stata dta files and suggested workarounds (:issue:`25772`)
11631163
- Improved :meth:`pandas.read_stata` and :class:`pandas.io.stata.StataReader` to read incorrectly formatted 118 format files saved by Stata (:issue:`25960`)
11641164
- Improved the ``col_space`` parameter in :meth:`DataFrame.to_html` to accept a string so CSS length values can be set correctly (:issue:`25941`)
11651165
- Fixed bug in loading objects from S3 that contain ``#`` characters in the URL (:issue:`25945`)

doc/source/whatsnew/v1.0.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ or ``matplotlib.Axes.plot``. See :ref:`plotting.formatters` for more.
900900
- Removed ``pandas.plotting._matplotlib.tsplot``, use :meth:`Series.plot` instead (:issue:`19980`)
901901
- ``pandas.tseries.converter.register`` has been moved to :func:`pandas.plotting.register_matplotlib_converters` (:issue:`18307`)
902902
- :meth:`Series.plot` no longer accepts positional arguments, pass keyword arguments instead (:issue:`30003`)
903-
- :meth:`DataFrame.hist` and :meth:`Series.hist` no longer allows ``figsize="default"``, specify figure size by passinig a tuple instead (:issue:`30003`)
903+
- :meth:`DataFrame.hist` and :meth:`Series.hist` no longer allows ``figsize="default"``, specify figure size by passing a tuple instead (:issue:`30003`)
904904
- Floordiv of integer-dtyped array by :class:`Timedelta` now raises ``TypeError`` (:issue:`21036`)
905905
- :class:`TimedeltaIndex` and :class:`DatetimeIndex` no longer accept non-nanosecond dtype strings like "timedelta64" or "datetime64", use "timedelta64[ns]" and "datetime64[ns]" instead (:issue:`24806`)
906906
- Changed the default "skipna" argument in :func:`pandas.api.types.infer_dtype` from ``False`` to ``True`` (:issue:`24050`)

doc/source/whatsnew/v2.0.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,7 @@ Performance improvements
11301130
- Performance improvement in :func:`to_datetime` when using ``'%Y%m%d'`` format (:issue:`17410`)
11311131
- Performance improvement in :func:`to_datetime` when format is given or can be inferred (:issue:`50465`)
11321132
- Performance improvement in :meth:`Series.median` for nullable dtypes (:issue:`50838`)
1133-
- Performance improvement in :func:`read_csv` when passing :func:`to_datetime` lambda-function to ``date_parser`` and inputs have mixed timezone offsetes (:issue:`35296`)
1133+
- Performance improvement in :func:`read_csv` when passing :func:`to_datetime` lambda-function to ``date_parser`` and inputs have mixed timezone offsets (:issue:`35296`)
11341134
- Performance improvement in :func:`isna` and :func:`isnull` (:issue:`50658`)
11351135
- Performance improvement in :meth:`.SeriesGroupBy.value_counts` with categorical dtype (:issue:`46202`)
11361136
- Fixed a reference leak in :func:`read_hdf` (:issue:`37441`)

pandas/_libs/tslibs/nattype.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1821,7 +1821,7 @@ default 'raise'
18211821

18221822
def as_unit(self, str unit, bint round_ok=True) -> "NaTType":
18231823
"""
1824-
Convert the underlying int64 representaton to the given unit.
1824+
Convert the underlying int64 representation to the given unit.
18251825

18261826
Parameters
18271827
----------

pandas/_libs/tslibs/np_datetime.pxd

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ cdef extern from "numpy/ndarraytypes.h":
3434
NPY_FR_as
3535
NPY_FR_GENERIC
3636

37-
int64_t NPY_DATETIME_NAT # elswhere we call this NPY_NAT
37+
int64_t NPY_DATETIME_NAT # elsewhere we call this NPY_NAT
3838

3939

4040
cdef extern from "pandas/datetime/pd_datetime.h":

pandas/_libs/tslibs/offsets.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ cdef class BaseOffset:
792792

793793
def __getstate__(self):
794794
"""
795-
Return a pickleable state
795+
Return a picklable state
796796
"""
797797
state = {}
798798
state["n"] = self.n
@@ -1456,7 +1456,7 @@ cdef class RelativeDeltaOffset(BaseOffset):
14561456

14571457
def __getstate__(self):
14581458
"""
1459-
Return a pickleable state
1459+
Return a picklable state
14601460
"""
14611461
# RelativeDeltaOffset (technically DateOffset) is the only non-cdef
14621462
# class, so the only one with __dict__

pandas/_libs/tslibs/timestamps.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ cdef class _Timestamp(ABCTimestamp):
321321
def _from_dt64(cls, dt64: np.datetime64):
322322
# construct a Timestamp from a np.datetime64 object, keeping the
323323
# resolution of the input.
324-
# This is herely mainly so we can incrementally implement non-nano
324+
# This is here mainly so we can incrementally implement non-nano
325325
# (e.g. only tznaive at first)
326326
cdef:
327327
int64_t value
@@ -1359,7 +1359,7 @@ cdef class _Timestamp(ABCTimestamp):
13591359
13601360
def as_unit(self, str unit, bint round_ok=True):
13611361
"""
1362-
Convert the underlying int64 representaton to the given unit.
1362+
Convert the underlying int64 representation to the given unit.
13631363

13641364
Parameters
13651365
----------

pandas/_typing.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ def closed(self) -> bool:
429429
SortKind = Literal["quicksort", "mergesort", "heapsort", "stable"]
430430
NaPosition = Literal["first", "last"]
431431

432-
# Arguments for nsmalles and n_largest
432+
# Arguments for nsmallest and nlargest
433433
NsmallestNlargestKeep = Literal["first", "last", "all"]
434434

435435
# quantile interpolation
@@ -524,7 +524,7 @@ def closed(self) -> bool:
524524
None,
525525
]
526526

527-
# maintaine the sub-type of any hashable sequence
527+
# maintain the sub-type of any hashable sequence
528528
SequenceT = TypeVar("SequenceT", bound=Sequence[Hashable])
529529

530530
SliceType = Optional[Hashable]

pandas/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file helps to compute a version number in source trees obtained from
2-
# git-archive tarball (such as those provided by githubs download-from-tag
2+
# git-archive tarball (such as those provided by github's download-from-tag
33
# feature). Distribution tarballs (built by setup.py sdist) and build
44
# directories (produced by setup.py build) will contain a much shorter file
55
# that just contains the computed version number.

pandas/core/arraylike.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ def dispatch_reduction_ufunc(self, ufunc: np.ufunc, method: str, *inputs, **kwar
522522
# so calls DataFrame.min (without ever getting here) with the np.min
523523
# default of axis=None, which DataFrame.min catches and changes to axis=0.
524524
# np.minimum.reduce(df) gets here bc axis is not in kwargs,
525-
# so we set axis=0 to match the behaviorof np.minimum.reduce(df.values)
525+
# so we set axis=0 to match the behavior of np.minimum.reduce(df.values)
526526
kwargs["axis"] = 0
527527

528528
# By default, numpy's reductions do not skip NaNs, so we have to

pandas/core/arrays/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1784,7 +1784,7 @@ def view(self, dtype: Dtype | None = None) -> ArrayLike:
17841784
--------
17851785
This gives view on the underlying data of an ``ExtensionArray`` and is not a
17861786
copy. Modifications on either the view or the original ``ExtensionArray``
1787-
will be reflectd on the underlying data:
1787+
will be reflected on the underlying data:
17881788
17891789
>>> arr = pd.array([1, 2, 3])
17901790
>>> arr2 = arr.view()

pandas/core/arrays/string_arrow.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ def isin(self, values: ArrayLike) -> npt.NDArray[np.bool_]:
257257
result = pc.is_in(
258258
self._pa_array, value_set=pa.array(value_set, type=self._pa_array.type)
259259
)
260-
# pyarrow 2.0.0 returned nulls, so we explicily specify dtype to convert nulls
260+
# pyarrow 2.0.0 returned nulls, so we explicitly specify dtype to convert nulls
261261
# to False
262262
return np.array(result, dtype=np.bool_)
263263

pandas/core/dtypes/cast.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1378,7 +1378,7 @@ def common_dtype_categorical_compat(
13781378
# TODO: more generally, could do `not can_hold_na(dtype)`
13791379
if lib.is_np_dtype(dtype, "iu"):
13801380
for obj in objs:
1381-
# We don't want to accientally allow e.g. "categorical" str here
1381+
# We don't want to accidentally allow e.g. "categorical" str here
13821382
obj_dtype = getattr(obj, "dtype", None)
13831383
if isinstance(obj_dtype, CategoricalDtype):
13841384
if isinstance(obj, ABCIndex):

pandas/core/frame.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -2199,7 +2199,7 @@ def maybe_reorder(
21992199
) -> tuple[list[ArrayLike], Index, Index | None]:
22002200
"""
22012201
If our desired 'columns' do not match the data's pre-existing 'arr_columns',
2202-
we re-order our arrays. This is like a pre-emptive (cheap) reindex.
2202+
we re-order our arrays. This is like a preemptive (cheap) reindex.
22032203
"""
22042204
if len(arrays):
22052205
length = len(arrays[0])
@@ -4484,7 +4484,7 @@ def query(self, expr: str, *, inplace: bool = False, **kwargs) -> DataFrame | No
44844484
44854485
You can refer to column names that are not valid Python variable names
44864486
by surrounding them in backticks. Thus, column names containing spaces
4487-
or punctuations (besides underscores) or starting with digits must be
4487+
or punctuation (besides underscores) or starting with digits must be
44884488
surrounded by backticks. (For example, a column named "Area (cm^2)" would
44894489
be referenced as ```Area (cm^2)```). Column names which are Python keywords
44904490
(like "if", "for", "import", etc) cannot be used.
@@ -12360,7 +12360,7 @@ def std(
1236012360
--------
1236112361
Series.std : Return standard deviation over Series values.
1236212362
DataFrame.mean : Return the mean of the values over the requested axis.
12363-
DataFrame.mediam : Return the mediam of the values over the requested axis.
12363+
DataFrame.median : Return the median of the values over the requested axis.
1236412364
DataFrame.mode : Get the mode(s) of each element along the requested axis.
1236512365
DataFrame.sum : Return the sum of the values over the requested axis.
1236612366

pandas/core/generic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6994,7 +6994,7 @@ def fillna(
69946994
f'you passed a "{type(value).__name__}"'
69956995
)
69966996

6997-
# set the default here, so functions examining the signaure
6997+
# set the default here, so functions examining the signature
69986998
# can detect if something was set (e.g. in groupby) (GH9221)
69996999
if axis is None:
70007000
axis = 0

pandas/core/indexes/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2943,7 +2943,7 @@ def _dti_setop_align_tzs(self, other: Index, setop: str_t) -> tuple[Index, Index
29432943
"""
29442944
With mismatched timezones, cast both to UTC.
29452945
"""
2946-
# Caller is responsibelf or checking
2946+
# Caller is responsible for checking
29472947
# `self.dtype != other.dtype`
29482948
if (
29492949
isinstance(self, ABCDatetimeIndex)

pandas/core/internals/blocks.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1478,7 +1478,7 @@ def round(self, decimals: int) -> Self:
14781478
"""
14791479
Rounds the values.
14801480
If the block is not of an integer or float dtype, nothing happens.
1481-
This is consistent with DataFrame.round behavivor.
1481+
This is consistent with DataFrame.round behavior.
14821482
(Note: Series.round would raise)
14831483
14841484
Parameters

pandas/core/internals/construction.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ def reorder_arrays(
621621
arrays: list[ArrayLike], arr_columns: Index, columns: Index | None, length: int
622622
) -> tuple[list[ArrayLike], Index]:
623623
"""
624-
Pre-emptively (cheaply) reindex arrays with new columns.
624+
Preemptively (cheaply) reindex arrays with new columns.
625625
"""
626626
# reorder according to the columns
627627
if columns is not None:

pandas/core/internals/managers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1362,7 +1362,7 @@ def _iset_split_block(
13621362
"""Removes columns from a block by splitting the block.
13631363
13641364
Avoids copying the whole block through slicing and updates the manager
1365-
after determinint the new block structure. Optionally adds a new block,
1365+
after determining the new block structure. Optionally adds a new block,
13661366
otherwise has to be done by the caller.
13671367
13681368
Parameters

pandas/core/reshape/concat.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def concat(
201201
be very expensive relative to the actual data concatenation.
202202
sort : bool, default False
203203
Sort non-concatenation axis. One exception to this is when the
204-
non-concatentation axis is a DatetimeIndex and join='outer' and the axis is
204+
non-concatenation axis is a DatetimeIndex and join='outer' and the axis is
205205
not already aligned. In that case, the non-concatenation axis is always
206206
sorted lexicographically.
207207
copy : bool, default False

pandas/errors/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ class InvalidIndexError(Exception):
378378

379379
class DataError(Exception):
380380
"""
381-
Exceptionn raised when performing an operation on non-numerical data.
381+
Exception raised when performing an operation on non-numerical data.
382382
383383
For example, calling ``ohlc`` on a non-numerical column or a function
384384
on a rolling window.

pandas/io/formats/style.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ def concat(self, other: Styler) -> Styler:
342342
keys ``data``, ``row_heading`` and ``row`` will be prepended with
343343
``foot0_``. If more concats are chained, their styles will be prepended
344344
with ``foot1_``, ''foot_2'', etc., and if a concatenated style have
345-
another concatanated style, the second style will be prepended with
345+
another concatenated style, the second style will be prepended with
346346
``foot{parent}_foot{child}_``.
347347
348348
A common use case is to concatenate user defined functions with

pandas/io/formats/style_render.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ def format(
10641064
10651065
.. warning::
10661066
`Styler.format` is ignored when using the output format `Styler.to_excel`,
1067-
since Excel and Python have inherrently different formatting structures.
1067+
since Excel and Python have inherently different formatting structures.
10681068
However, it is possible to use the `number-format` pseudo CSS attribute
10691069
to force Excel permissible formatting. See examples.
10701070
@@ -1312,7 +1312,7 @@ def format_index(
13121312
13131313
.. warning::
13141314
`Styler.format_index` is ignored when using the output format
1315-
`Styler.to_excel`, since Excel and Python have inherrently different
1315+
`Styler.to_excel`, since Excel and Python have inherently different
13161316
formatting structures.
13171317
However, it is possible to use the `number-format` pseudo CSS attribute
13181318
to force Excel permissible formatting. See documentation for `Styler.format`.
@@ -1649,7 +1649,7 @@ def format_index_names(
16491649
16501650
.. warning::
16511651
`Styler.format_index_names` is ignored when using the output format
1652-
`Styler.to_excel`, since Excel and Python have inherrently different
1652+
`Styler.to_excel`, since Excel and Python have inherently different
16531653
formatting structures.
16541654
16551655
Examples
@@ -2410,7 +2410,7 @@ def _parse_latex_header_span(
24102410
r"""
24112411
Refactor the cell `display_value` if a 'colspan' or 'rowspan' attribute is present.
24122412
2413-
'rowspan' and 'colspan' do not occur simultaneouly. If they are detected then
2413+
'rowspan' and 'colspan' do not occur simultaneously. If they are detected then
24142414
the `display_value` is altered to a LaTeX `multirow` or `multicol` command
24152415
respectively, with the appropriate cell-span.
24162416

0 commit comments

Comments
 (0)