@@ -242,7 +242,7 @@ def _get_grouper(self, obj):
242
242
243
243
def _set_grouper (self , obj , sort = False ):
244
244
"""
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
246
246
247
247
Parameters
248
248
----------
@@ -1962,7 +1962,7 @@ def __init__(self, index, grouper=None, obj=None, name=None, level=None,
1962
1962
1963
1963
# technically we cannot group on an unordered Categorical
1964
1964
# 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
1966
1966
pass
1967
1967
1968
1968
# 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):
2069
2069
Groupers enable local references to axis,level,sort, while
2070
2070
the passed in axis, level, and sort are 'global'.
2071
2071
2072
- This routine tries to figure of what the passing in references
2072
+ This routine tries to figure out what the passing in references
2073
2073
are and then creates a Grouping for each one, combined into
2074
2074
a BaseGrouper.
2075
2075
2076
2076
"""
2077
2077
2078
2078
group_axis = obj ._get_axis (axis )
2079
2079
2080
- # validate thatthe passed level is compatible with the passed
2080
+ # validate that the passed level is compatible with the passed
2081
2081
# axis of the object
2082
2082
if level is not None :
2083
2083
if not isinstance (group_axis , MultiIndex ):
@@ -2091,7 +2091,7 @@ def _get_grouper(obj, key=None, axis=0, level=None, sort=True):
2091
2091
level = None
2092
2092
key = group_axis
2093
2093
2094
- # a passed in Grouper, directly convert
2094
+ # a passed- in Grouper, directly convert
2095
2095
if isinstance (key , Grouper ):
2096
2096
binner , grouper , obj = key ._get_grouper (obj )
2097
2097
if key .key is None :
@@ -2568,7 +2568,7 @@ def nunique(self, dropna=True):
2568
2568
2569
2569
ids , val = ids [sorter ], val [sorter ]
2570
2570
2571
- # group boundries are where group ids change
2571
+ # group boundaries are where group ids change
2572
2572
# unique observations are where sorted values change
2573
2573
idx = np .r_ [0 , 1 + np .nonzero (ids [1 :] != ids [:- 1 ])[0 ]]
2574
2574
inc = np .r_ [1 , val [1 :] != val [:- 1 ]]
@@ -2591,7 +2591,7 @@ def nunique(self, dropna=True):
2591
2591
@Appender (Series .nlargest .__doc__ )
2592
2592
def nlargest (self , n = 5 , keep = 'first' ):
2593
2593
# 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
2595
2595
return self .apply (lambda x : x .nlargest (n = n , keep = keep ))
2596
2596
2597
2597
@@ -2634,12 +2634,12 @@ def value_counts(self, normalize=False, sort=True, ascending=False,
2634
2634
sorter = np .lexsort ((lab , ids ))
2635
2635
ids , lab = ids [sorter ], lab [sorter ]
2636
2636
2637
- # group boundries are where group ids change
2637
+ # group boundaries are where group ids change
2638
2638
idx = np .r_ [0 , 1 + np .nonzero (ids [1 :] != ids [:- 1 ])[0 ]]
2639
2639
2640
2640
# new values are where sorted labels change
2641
2641
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
2643
2643
out = np .diff (np .nonzero (np .r_ [inc , True ])[0 ]) # value counts
2644
2644
2645
2645
# num. of times each group should be repeated
@@ -2919,8 +2919,6 @@ def _aggregate_generic(self, func, *args, **kwargs):
2919
2919
if axis != obj ._info_axis_number :
2920
2920
try :
2921
2921
for name , data in self :
2922
- # for name in self.indices:
2923
- # data = self.get_group(name, obj=obj)
2924
2922
result [name ] = self ._try_cast (func (data , * args , ** kwargs ),
2925
2923
data )
2926
2924
except Exception :
@@ -3742,7 +3740,7 @@ def get_group_index(labels, shape, sort, xnull):
3742
3740
sort: boolean
3743
3741
If the ranks of returned ids should match lexical ranks of labels
3744
3742
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
3746
3744
passed through
3747
3745
Returns
3748
3746
-------
0 commit comments