Skip to content

Commit fae9f8c

Browse files
authored
CLN: typos (#43575)
1 parent 5872bfe commit fae9f8c

File tree

9 files changed

+22
-22
lines changed

9 files changed

+22
-22
lines changed

asv_bench/benchmarks/groupby.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,16 @@ def setup(self, dtype, method, application, ncols):
454454
# DataFrameGroupBy doesn't have these methods
455455
raise NotImplementedError
456456

457+
if application == "transformation" and method in [
458+
"head",
459+
"tail",
460+
"unique",
461+
"value_counts",
462+
"size",
463+
]:
464+
# DataFrameGroupBy doesn't have these methods
465+
raise NotImplementedError
466+
457467
ngroups = 1000
458468
size = ngroups * 2
459469
rng = np.arange(ngroups).reshape(-1, 1)
@@ -480,7 +490,7 @@ def setup(self, dtype, method, application, ncols):
480490
if len(cols) == 1:
481491
cols = cols[0]
482492

483-
if application == "transform":
493+
if application == "transformation":
484494
if method == "describe":
485495
raise NotImplementedError
486496

pandas/_libs/internals.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class BlockPlacement:
5151
def __len__(self) -> int: ...
5252
def delete(self, loc) -> BlockPlacement: ...
5353
def append(self, others: list[BlockPlacement]) -> BlockPlacement: ...
54-
def tile_for_unstack(self, factor: int) -> np.ndarray: ...
54+
def tile_for_unstack(self, factor: int) -> npt.NDArray[np.intp]: ...
5555

5656
class SharedBlock:
5757
_mgr_locs: BlockPlacement

pandas/_libs/reduction.pyx

-13
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,11 @@
1-
2-
from libc.stdlib cimport (
3-
free,
4-
malloc,
5-
)
6-
71
import numpy as np
82

93
cimport numpy as cnp
10-
from numpy cimport (
11-
int64_t,
12-
intp_t,
13-
ndarray,
14-
)
154

165
cnp.import_array()
176

187
from pandas._libs.util cimport is_array
198

20-
from pandas._libs.lib import is_scalar
21-
229

2310
cdef cnp.dtype _dtype_obj = np.dtype("object")
2411

pandas/_libs/tslibs/strptime.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ def array_strptime(
99
errors: str = "raise",
1010
) -> tuple[np.ndarray, np.ndarray]: ...
1111

12-
# first ndarray is M8[ns], second is object ndarray of tzinfo | None
12+
# first ndarray is M8[ns], second is object ndarray of tzinfo | None

pandas/core/groupby/grouper.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ def codes(self) -> np.ndarray:
617617
def group_arraylike(self) -> ArrayLike:
618618
"""
619619
Analogous to result_index, but holding an ArrayLike to ensure
620-
we can can retain ExtensionDtypes.
620+
we can retain ExtensionDtypes.
621621
"""
622622
if self._group_index is not None:
623623
# _group_index is set in __init__ for MultiIndex cases

pandas/core/indexes/base.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -3060,7 +3060,7 @@ def _union(self, other: Index, sort):
30603060
try:
30613061
return self._outer_indexer(other)[0]
30623062
except (TypeError, IncompatibleFrequency):
3063-
# incomparable objects
3063+
# incomparable objects; should only be for object dtype
30643064
value_list = list(lvals)
30653065

30663066
# worth making this faster? a very unusual case
@@ -3074,7 +3074,7 @@ def _union(self, other: Index, sort):
30743074
result = algos.union_with_duplicates(lvals, rvals)
30753075
return _maybe_try_sort(result, sort)
30763076

3077-
# Self may have duplicates
3077+
# Self may have duplicates; other already checked as unique
30783078
# find indexes of things in "other" that are not in "self"
30793079
if self._index_as_unique:
30803080
indexer = self.get_indexer(other)
@@ -3089,6 +3089,7 @@ def _union(self, other: Index, sort):
30893089
result = lvals
30903090

30913091
if not self.is_monotonic or not other.is_monotonic:
3092+
# if both are monotonic then result should already be sorted
30923093
result = _maybe_try_sort(result, sort)
30933094

30943095
return result
@@ -3194,6 +3195,7 @@ def _intersection(self, other: Index, sort=False):
31943195
try:
31953196
result = self._inner_indexer(other)[0]
31963197
except TypeError:
3198+
# non-comparable; should only be for object dtype
31973199
pass
31983200
else:
31993201
# TODO: algos.unique1d should preserve DTA/TDA
@@ -4485,7 +4487,7 @@ def _get_leaf_sorter(labels: list[np.ndarray]) -> npt.NDArray[np.intp]:
44854487
def _join_monotonic(
44864488
self, other: Index, how: str_t = "left"
44874489
) -> tuple[Index, npt.NDArray[np.intp] | None, npt.NDArray[np.intp] | None]:
4488-
# We only get here with matching dtypes
4490+
# We only get here with matching dtypes and both monotonic increasing
44894491
assert other.dtype == self.dtype
44904492

44914493
if self.equals(other):

pandas/core/internals/array_manager.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ def quantile(
10351035

10361036
def unstack(self, unstacker, fill_value) -> ArrayManager:
10371037
"""
1038-
Return a BlockManager with all blocks unstacked..
1038+
Return a BlockManager with all blocks unstacked.
10391039
10401040
Parameters
10411041
----------

pandas/core/internals/blocks.py

+1
Original file line numberDiff line numberDiff line change
@@ -1291,6 +1291,7 @@ def _unstack(self, unstacker, fill_value, new_placement, allow_fill: bool):
12911291
unstacker : reshape._Unstacker
12921292
fill_value : int
12931293
Only used in ExtensionBlock._unstack
1294+
new_placement : np.ndarray[np.intp]
12941295
allow_fill : bool
12951296
12961297
Returns

pandas/core/internals/managers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1380,7 +1380,7 @@ def quantile(
13801380

13811381
def unstack(self, unstacker, fill_value) -> BlockManager:
13821382
"""
1383-
Return a BlockManager with all blocks unstacked..
1383+
Return a BlockManager with all blocks unstacked.
13841384
13851385
Parameters
13861386
----------

0 commit comments

Comments
 (0)