Skip to content

Commit e037f61

Browse files
committed
Merge branch 'master' of https://github.com/pandas-dev/pandas into ref-tests7
2 parents fc7b5fc + 710df21 commit e037f61

Some content is hidden

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

47 files changed

+502
-532
lines changed

.binstar.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

ci/setup_env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ conda list pandas
121121
# Make sure any error below is reported as such
122122

123123
echo "[Build extensions]"
124-
python setup.py build_ext -q -i
124+
python setup.py build_ext -q -i -j2
125125

126126
# XXX: Some of our environments end up with old versions of pip (10.x)
127127
# Adding a new enough version of pip to the requirements explodes the

doc/source/user_guide/advanced.rst

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 67 additions & 68 deletions
Large diffs are not rendered by default.

pandas/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
try:
1111
__import__(dependency)
1212
except ImportError as e:
13-
missing_dependencies.append("{0}: {1}".format(dependency, str(e)))
13+
missing_dependencies.append(f"{dependency}: {e}")
1414

1515
if missing_dependencies:
1616
raise ImportError(
@@ -33,10 +33,10 @@
3333
# hack but overkill to use re
3434
module = str(e).replace("cannot import name ", "")
3535
raise ImportError(
36-
"C extension: {0} not built. If you want to import "
36+
f"C extension: {module} not built. If you want to import "
3737
"pandas from the source directory, you may need to run "
3838
"'python setup.py build_ext --inplace --force' to build "
39-
"the C extensions first.".format(module)
39+
"the C extensions first."
4040
)
4141

4242
from datetime import datetime
@@ -213,16 +213,16 @@ class Panel:
213213
return Panel
214214
elif name in {"SparseSeries", "SparseDataFrame"}:
215215
warnings.warn(
216-
"The {} class is removed from pandas. Accessing it from "
216+
f"The {name} class is removed from pandas. Accessing it from "
217217
"the top-level namespace will also be removed in the next "
218-
"version".format(name),
218+
"version",
219219
FutureWarning,
220220
stacklevel=2,
221221
)
222222

223223
return type(name, (), {})
224224

225-
raise AttributeError("module 'pandas' has no attribute '{}'".format(name))
225+
raise AttributeError(f"module 'pandas' has no attribute '{name}'")
226226

227227

228228
else:

pandas/_libs/intervaltree.pxi.in

Lines changed: 0 additions & 37 deletions
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/_libs/reshape.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def unstack(reshape_t[:, :] values, uint8_t[:] mask,
2828
Py_ssize_t stride, Py_ssize_t length, Py_ssize_t width,
2929
reshape_t[:, :] new_values, uint8_t[:, :] new_mask):
3030
"""
31-
transform long sorted_values to wide new_values
31+
Transform long values to wide new_values.
3232
3333
Parameters
3434
----------

pandas/core/arrays/datetimelike.py

Lines changed: 3 additions & 3 deletions
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

0 commit comments

Comments
 (0)