Skip to content

Commit adca461

Browse files
authored
Merge pull request #1 from pandas-dev/master
Sync
2 parents e46026f + cde73af commit adca461

File tree

25 files changed

+126
-159
lines changed

25 files changed

+126
-159
lines changed

doc/source/user_guide/advanced.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ When working with an ``Index`` object directly, rather than via a ``DataFrame``,
573573
.. code-block:: none
574574
575575
>>> mi.levels[0].name = 'name via level'
576-
>>> mi.names[0] # only works for older panads
576+
>>> mi.names[0] # only works for older pandas
577577
'name via level'
578578
579579
As of pandas 1.0, this will *silently* fail to update the names

doc/source/user_guide/missing_data.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ the nullable :doc:`integer <integer_na>`, boolean and
791791
:ref:`dedicated string <text.types>` data types as the missing value indicator.
792792

793793
The goal of ``pd.NA`` is provide a "missing" indicator that can be used
794-
consistently accross data types (instead of ``np.nan``, ``None`` or ``pd.NaT``
794+
consistently across data types (instead of ``np.nan``, ``None`` or ``pd.NaT``
795795
depending on the data type).
796796

797797
For example, when having missing values in a Series with the nullable integer

doc/source/user_guide/text.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ l. For ``StringDtype``, :ref:`string accessor methods<api.series.str>`
101101
2. Some string methods, like :meth:`Series.str.decode` are not available
102102
on ``StringArray`` because ``StringArray`` only holds strings, not
103103
bytes.
104-
3. In comparision operations, :class:`arrays.StringArray` and ``Series`` backed
104+
3. In comparison operations, :class:`arrays.StringArray` and ``Series`` backed
105105
by a ``StringArray`` will return an object with :class:`BooleanDtype`,
106106
rather than a ``bool`` dtype object. Missing values in a ``StringArray``
107-
will propagate in comparision operations, rather than always comparing
107+
will propagate in comparison operations, rather than always comparing
108108
unequal like :attr:`numpy.nan`.
109109

110110
Everything else that follows in the rest of this document applies equally to

doc/source/whatsnew/v1.0.0.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ A new ``pd.NA`` value (singleton) is introduced to represent scalar missing
111111
values. Up to now, ``np.nan`` is used for this for float data, ``np.nan`` or
112112
``None`` for object-dtype data and ``pd.NaT`` for datetime-like data. The
113113
goal of ``pd.NA`` is provide a "missing" indicator that can be used
114-
consistently accross data types. For now, the nullable integer and boolean
114+
consistently across data types. For now, the nullable integer and boolean
115115
data types and the new string data type make use of ``pd.NA`` (:issue:`28095`).
116116

117117
.. warning::
@@ -826,7 +826,7 @@ Plotting
826826
- Bug where :meth:`DataFrame.boxplot` would not accept a `color` parameter like `DataFrame.plot.box` (:issue:`26214`)
827827
- Bug in the ``xticks`` argument being ignored for :meth:`DataFrame.plot.bar` (:issue:`14119`)
828828
- :func:`set_option` now validates that the plot backend provided to ``'plotting.backend'`` implements the backend when the option is set, rather than when a plot is created (:issue:`28163`)
829-
- :meth:`DataFrame.plot` now allow a ``backend`` keyword arugment to allow changing between backends in one session (:issue:`28619`).
829+
- :meth:`DataFrame.plot` now allow a ``backend`` keyword argument to allow changing between backends in one session (:issue:`28619`).
830830
- Bug in color validation incorrectly raising for non-color styles (:issue:`29122`).
831831

832832
Groupby/resample/rolling

pandas/_libs/intervaltree.pxi.in

-37
Original file line numberDiff line numberDiff line change
@@ -114,43 +114,6 @@ cdef class IntervalTree(IntervalMixin):
114114
sort_order = np.lexsort(values)
115115
return is_monotonic(sort_order, False)[0]
116116

117-
def get_loc(self, scalar_t key):
118-
"""Return all positions corresponding to intervals that overlap with
119-
the given scalar key
120-
"""
121-
result = Int64Vector()
122-
self.root.query(result, key)
123-
if not result.data.n:
124-
raise KeyError(key)
125-
return result.to_array().astype('intp')
126-
127-
def _get_partial_overlap(self, key_left, key_right, side):
128-
"""Return all positions corresponding to intervals with the given side
129-
falling between the left and right bounds of an interval query
130-
"""
131-
if side == 'left':
132-
values = self.left
133-
sorter = self.left_sorter
134-
else:
135-
values = self.right
136-
sorter = self.right_sorter
137-
key = [key_left, key_right]
138-
i, j = values.searchsorted(key, sorter=sorter)
139-
return sorter[i:j]
140-
141-
def get_loc_interval(self, key_left, key_right):
142-
"""Lookup the intervals enclosed in the given interval bounds
143-
144-
The given interval is presumed to have closed bounds.
145-
"""
146-
import pandas as pd
147-
left_overlap = self._get_partial_overlap(key_left, key_right, 'left')
148-
right_overlap = self._get_partial_overlap(key_left, key_right, 'right')
149-
enclosing = self.get_loc(0.5 * (key_left + key_right))
150-
combined = np.concatenate([left_overlap, right_overlap, enclosing])
151-
uniques = pd.unique(combined)
152-
return uniques.astype('intp')
153-
154117
def get_indexer(self, scalar_t[:] target):
155118
"""Return the positions corresponding to unique intervals that overlap
156119
with the given array of scalar targets.

pandas/core/arrays/datetimelike.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@ def _is_unique(self):
915915
__rdivmod__ = make_invalid_op("__rdivmod__")
916916

917917
def _add_datetimelike_scalar(self, other):
918-
# Overriden by TimedeltaArray
918+
# Overridden by TimedeltaArray
919919
raise TypeError(f"cannot add {type(self).__name__} and {type(other).__name__}")
920920

921921
_add_datetime_arraylike = _add_datetimelike_scalar
@@ -928,7 +928,7 @@ def _sub_datetimelike_scalar(self, other):
928928
_sub_datetime_arraylike = _sub_datetimelike_scalar
929929

930930
def _sub_period(self, other):
931-
# Overriden by PeriodArray
931+
# Overridden by PeriodArray
932932
raise TypeError(f"cannot subtract Period from a {type(self).__name__}")
933933

934934
def _add_offset(self, offset):
@@ -1085,7 +1085,7 @@ def _addsub_int_array(self, other, op):
10851085
-------
10861086
result : same class as self
10871087
"""
1088-
# _addsub_int_array is overriden by PeriodArray
1088+
# _addsub_int_array is overridden by PeriodArray
10891089
assert not is_period_dtype(self)
10901090
assert op in [operator.add, operator.sub]
10911091

pandas/core/groupby/groupby.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class providing the base-class of operations.
44
55
The SeriesGroupBy and DataFrameGroupBy sub-class
66
(defined in pandas.core.groupby.generic)
7-
expose these user-facing objects to provide specific functionailty.
7+
expose these user-facing objects to provide specific functionality.
88
"""
99

1010
from contextlib import contextmanager

pandas/core/indexes/interval.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ def get_indexer(
978978
right_indexer = self.right.get_indexer(target_as_index.right)
979979
indexer = np.where(left_indexer == right_indexer, left_indexer, -1)
980980
elif is_categorical(target_as_index):
981-
# get an indexer for unique categories then propogate to codes via take_1d
981+
# get an indexer for unique categories then propagate to codes via take_1d
982982
categories_indexer = self.get_indexer(target_as_index.categories)
983983
indexer = take_1d(categories_indexer, target_as_index.codes, fill_value=-1)
984984
elif not is_object_dtype(target_as_index):

pandas/core/internals/blocks.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1449,7 +1449,7 @@ def quantile(self, qs, interpolation="linear", axis=0):
14491449
-------
14501450
Block
14511451
"""
1452-
# We should always have ndim == 2 becase Series dispatches to DataFrame
1452+
# We should always have ndim == 2 because Series dispatches to DataFrame
14531453
assert self.ndim == 2
14541454

14551455
values = self.get_values()
@@ -2432,7 +2432,7 @@ def fillna(self, value, **kwargs):
24322432
# Deprecation GH#24694, GH#19233
24332433
raise TypeError(
24342434
"Passing integers to fillna for timedelta64[ns] dtype is no "
2435-
"longer supporetd. To obtain the old behavior, pass "
2435+
"longer supported. To obtain the old behavior, pass "
24362436
"`pd.Timedelta(seconds=n)` instead."
24372437
)
24382438
return super().fillna(value, **kwargs)
@@ -2971,7 +2971,7 @@ def make_block(values, placement, klass=None, ndim=None, dtype=None):
29712971

29722972

29732973
def _extend_blocks(result, blocks=None):
2974-
""" return a new extended blocks, givin the result """
2974+
""" return a new extended blocks, given the result """
29752975
from pandas.core.internals import BlockManager
29762976

29772977
if blocks is None:

pandas/core/nanops.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1337,7 +1337,7 @@ def f(x, y):
13371337

13381338
def _nanpercentile_1d(values, mask, q, na_value, interpolation):
13391339
"""
1340-
Wraper for np.percentile that skips missing values, specialized to
1340+
Wrapper for np.percentile that skips missing values, specialized to
13411341
1-dimensional case.
13421342
13431343
Parameters
@@ -1368,7 +1368,7 @@ def _nanpercentile_1d(values, mask, q, na_value, interpolation):
13681368

13691369
def nanpercentile(values, q, axis, na_value, mask, ndim, interpolation):
13701370
"""
1371-
Wraper for np.percentile that skips missing values.
1371+
Wrapper for np.percentile that skips missing values.
13721372
13731373
Parameters
13741374
----------

pandas/core/series.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ def __array__(self, dtype=None):
727727
Timestamp('2000-01-02 00:00:00+0100', tz='CET', freq='D')],
728728
dtype=object)
729729
730-
Or the values may be localized to UTC and the tzinfo discared with
730+
Or the values may be localized to UTC and the tzinfo discarded with
731731
``dtype='datetime64[ns]'``
732732
733733
>>> np.asarray(tzser, dtype="datetime64[ns]") # doctest: +ELLIPSIS

0 commit comments

Comments
 (0)