Skip to content

Commit ef9a79d

Browse files
robertzkjreback
authored andcommitted
DOC: Fix typos in Grouper private method documentation.
1 parent e8339f7 commit ef9a79d

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

pandas/core/groupby.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def _get_grouper(self, obj):
242242

243243
def _set_grouper(self, obj, sort=False):
244244
"""
245-
given an object and the specifcations, setup the internal grouper for this particular specification
245+
given an object and the specifications, setup the internal grouper for this particular specification
246246
247247
Parameters
248248
----------
@@ -1962,7 +1962,7 @@ def __init__(self, index, grouper=None, obj=None, name=None, level=None,
19621962

19631963
# technically we cannot group on an unordered Categorical
19641964
# but this a user convenience to do so; the ordering
1965-
# is preserved and if its a reduction is doesnt't make any difference
1965+
# is preserved and if it's a reduction it doesn't make any difference
19661966
pass
19671967

19681968
# fix bug #GH8868 sort=False being ignored in categorical groupby
@@ -2069,15 +2069,15 @@ def _get_grouper(obj, key=None, axis=0, level=None, sort=True):
20692069
Groupers enable local references to axis,level,sort, while
20702070
the passed in axis, level, and sort are 'global'.
20712071
2072-
This routine tries to figure of what the passing in references
2072+
This routine tries to figure out what the passing in references
20732073
are and then creates a Grouping for each one, combined into
20742074
a BaseGrouper.
20752075
20762076
"""
20772077

20782078
group_axis = obj._get_axis(axis)
20792079

2080-
# validate thatthe passed level is compatible with the passed
2080+
# validate that the passed level is compatible with the passed
20812081
# axis of the object
20822082
if level is not None:
20832083
if not isinstance(group_axis, MultiIndex):
@@ -2091,7 +2091,7 @@ def _get_grouper(obj, key=None, axis=0, level=None, sort=True):
20912091
level = None
20922092
key = group_axis
20932093

2094-
# a passed in Grouper, directly convert
2094+
# a passed-in Grouper, directly convert
20952095
if isinstance(key, Grouper):
20962096
binner, grouper, obj = key._get_grouper(obj)
20972097
if key.key is None:
@@ -2568,7 +2568,7 @@ def nunique(self, dropna=True):
25682568

25692569
ids, val = ids[sorter], val[sorter]
25702570

2571-
# group boundries are where group ids change
2571+
# group boundaries are where group ids change
25722572
# unique observations are where sorted values change
25732573
idx = np.r_[0, 1 + np.nonzero(ids[1:] != ids[:-1])[0]]
25742574
inc = np.r_[1, val[1:] != val[:-1]]
@@ -2591,7 +2591,7 @@ def nunique(self, dropna=True):
25912591
@Appender(Series.nlargest.__doc__)
25922592
def nlargest(self, n=5, keep='first'):
25932593
# ToDo: When we remove deprecate_kwargs, we can remote these methods
2594-
# and inlucde nlargest and nsmallest to _series_apply_whitelist
2594+
# and include nlargest and nsmallest to _series_apply_whitelist
25952595
return self.apply(lambda x: x.nlargest(n=n, keep=keep))
25962596

25972597

@@ -2634,12 +2634,12 @@ def value_counts(self, normalize=False, sort=True, ascending=False,
26342634
sorter = np.lexsort((lab, ids))
26352635
ids, lab = ids[sorter], lab[sorter]
26362636

2637-
# group boundries are where group ids change
2637+
# group boundaries are where group ids change
26382638
idx = np.r_[0, 1 + np.nonzero(ids[1:] != ids[:-1])[0]]
26392639

26402640
# new values are where sorted labels change
26412641
inc = np.r_[True, lab[1:] != lab[:-1]]
2642-
inc[idx] = True # group boundries are also new values
2642+
inc[idx] = True # group boundaries are also new values
26432643
out = np.diff(np.nonzero(np.r_[inc, True])[0]) # value counts
26442644

26452645
# num. of times each group should be repeated
@@ -2919,8 +2919,6 @@ def _aggregate_generic(self, func, *args, **kwargs):
29192919
if axis != obj._info_axis_number:
29202920
try:
29212921
for name, data in self:
2922-
# for name in self.indices:
2923-
# data = self.get_group(name, obj=obj)
29242922
result[name] = self._try_cast(func(data, *args, **kwargs),
29252923
data)
29262924
except Exception:
@@ -3742,7 +3740,7 @@ def get_group_index(labels, shape, sort, xnull):
37423740
sort: boolean
37433741
If the ranks of returned ids should match lexical ranks of labels
37443742
xnull: boolean
3745-
If true nulls are eXcluded. i.e. -1 values in the labels are
3743+
If true nulls are excluded. i.e. -1 values in the labels are
37463744
passed through
37473745
Returns
37483746
-------

0 commit comments

Comments
 (0)