Skip to content

CLN: typos #43575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion asv_bench/benchmarks/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,16 @@ def setup(self, dtype, method, application, ncols):
# DataFrameGroupBy doesn't have these methods
raise NotImplementedError

if application == "transformation" and method in [
"head",
"tail",
"unique",
"value_counts",
"size",
]:
# DataFrameGroupBy doesn't have these methods
raise NotImplementedError

ngroups = 1000
size = ngroups * 2
rng = np.arange(ngroups).reshape(-1, 1)
Expand All @@ -480,7 +490,7 @@ def setup(self, dtype, method, application, ncols):
if len(cols) == 1:
cols = cols[0]

if application == "transform":
if application == "transformation":
if method == "describe":
raise NotImplementedError

Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/internals.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class BlockPlacement:
def __len__(self) -> int: ...
def delete(self, loc) -> BlockPlacement: ...
def append(self, others: list[BlockPlacement]) -> BlockPlacement: ...
def tile_for_unstack(self, factor: int) -> np.ndarray: ...
def tile_for_unstack(self, factor: int) -> npt.NDArray[np.intp]: ...

class SharedBlock:
_mgr_locs: BlockPlacement
Expand Down
13 changes: 0 additions & 13 deletions pandas/_libs/reduction.pyx
Original file line number Diff line number Diff line change
@@ -1,24 +1,11 @@

from libc.stdlib cimport (
free,
malloc,
)

import numpy as np

cimport numpy as cnp
from numpy cimport (
int64_t,
intp_t,
ndarray,
)

cnp.import_array()

from pandas._libs.util cimport is_array

from pandas._libs.lib import is_scalar


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

Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/strptime.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ def array_strptime(
errors: str = "raise",
) -> tuple[np.ndarray, np.ndarray]: ...

# first ndarray is M8[ns], second is object ndarray of tzinfo | None
# first ndarray is M8[ns], second is object ndarray of tzinfo | None
2 changes: 1 addition & 1 deletion pandas/core/groupby/grouper.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ def codes(self) -> np.ndarray:
def group_arraylike(self) -> ArrayLike:
"""
Analogous to result_index, but holding an ArrayLike to ensure
we can can retain ExtensionDtypes.
we can retain ExtensionDtypes.
"""
if self._group_index is not None:
# _group_index is set in __init__ for MultiIndex cases
Expand Down
8 changes: 5 additions & 3 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3060,7 +3060,7 @@ def _union(self, other: Index, sort):
try:
return self._outer_indexer(other)[0]
except (TypeError, IncompatibleFrequency):
# incomparable objects
# incomparable objects; should only be for object dtype
value_list = list(lvals)

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

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

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

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

if self.equals(other):
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/internals/array_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ def quantile(

def unstack(self, unstacker, fill_value) -> ArrayManager:
"""
Return a BlockManager with all blocks unstacked..
Return a BlockManager with all blocks unstacked.

Parameters
----------
Expand Down
1 change: 1 addition & 0 deletions pandas/core/internals/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1291,6 +1291,7 @@ def _unstack(self, unstacker, fill_value, new_placement, allow_fill: bool):
unstacker : reshape._Unstacker
fill_value : int
Only used in ExtensionBlock._unstack
new_placement : np.ndarray[np.intp]
allow_fill : bool

Returns
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/internals/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1376,7 +1376,7 @@ def quantile(

def unstack(self, unstacker, fill_value) -> BlockManager:
"""
Return a BlockManager with all blocks unstacked..
Return a BlockManager with all blocks unstacked.

Parameters
----------
Expand Down