Skip to content

Commit 0aea823

Browse files
committed
rm unnecessary dropna
1 parent 5ae4539 commit 0aea823

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

pandas/core/categorical.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2068,4 +2068,4 @@ def _factorize_from_iterables(iterables, dropna=True):
20682068
# For consistency, it should return a list of 2 lists.
20692069
return [[], []]
20702070
return map(list, lzip(*[_factorize_from_iterable(it, dropna=dropna)
2071-
for it in iterables]))
2071+
for it in iterables]))

pandas/core/groupby.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,10 @@ def _groupby_function(name, alias, npfunc, numeric_only=True,
108108
@Substitution(name='groupby', f=name)
109109
@Appender(_doc_template)
110110
@Appender(_local_template)
111-
def f(self, dropna=True):
111+
def f(self):
112112
self._set_group_selection()
113113
try:
114-
return self._cython_agg_general(alias, numeric_only=numeric_only,
115-
dropna=dropna)
114+
return self._cython_agg_general(alias, numeric_only=numeric_only)
116115
except AssertionError as e:
117116
raise SpecificationError(str(e))
118117
except Exception:
@@ -362,7 +361,6 @@ def __init__(self, obj, keys=None, axis=0, level=None, dropna=True,
362361
self.group_keys = group_keys
363362
self.squeeze = squeeze
364363
self.mutated = kwargs.pop('mutated', False)
365-
self.dropna = dropna
366364

367365
if grouper is None:
368366
grouper, exclusions, obj = _get_grouper(obj, keys,
@@ -1529,14 +1527,13 @@ class BaseGrouper(object):
15291527
"""
15301528

15311529
def __init__(self, axis, groupings, sort=True, group_keys=True,
1532-
mutated=False, dropna=True):
1530+
mutated=False):
15331531
self._filter_empty_groups = self.compressed = len(groupings) != 1
15341532
self.axis = axis
15351533
self.groupings = groupings
15361534
self.sort = sort
15371535
self.group_keys = group_keys
15381536
self.mutated = mutated
1539-
self.dropna = dropna
15401537

15411538
@property
15421539
def shape(self):
@@ -2486,8 +2483,7 @@ def is_in_obj(gpr):
24862483
raise ValueError('No group keys passed!')
24872484

24882485
# create the internals grouper
2489-
grouper = BaseGrouper(group_axis, groupings, sort=sort, mutated=mutated,
2490-
dropna=dropna)
2486+
grouper = BaseGrouper(group_axis, groupings, sort=sort, mutated=mutated)
24912487

24922488
return grouper, exclusions, obj
24932489

@@ -3116,9 +3112,9 @@ def _iterate_slices(self):
31163112
continue
31173113
yield val, slicer(val)
31183114

3119-
def _cython_agg_general(self, how, numeric_only=True, dropna=True):
3115+
def _cython_agg_general(self, how, numeric_only=True):
31203116
new_items, new_blocks = self._cython_agg_blocks(
3121-
how, numeric_only=numeric_only, dropna=dropna)
3117+
how, numeric_only=numeric_only)
31223118
return self._wrap_agged_blocks(new_items, new_blocks)
31233119

31243120
def _wrap_agged_blocks(self, items, blocks):
@@ -3144,7 +3140,7 @@ def _wrap_agged_blocks(self, items, blocks):
31443140

31453141
_block_agg_axis = 0
31463142

3147-
def _cython_agg_blocks(self, how, numeric_only=True, dropna=True):
3143+
def _cython_agg_blocks(self, how, numeric_only=True):
31483144
data, agg_axis = self._get_data_to_aggregate()
31493145

31503146
new_blocks = []

0 commit comments

Comments
 (0)