Skip to content

Commit 04f353c

Browse files
committed
Get rid of nonzero() in dropna()
1 parent efea87a commit 04f353c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pandas/core/frame.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4480,7 +4480,10 @@ def dropna(self, axis=0, how='any', thresh=None, subset=None,
44804480
else:
44814481
raise TypeError('must specify how or thresh')
44824482

4483-
result = self._take(mask.nonzero()[0], axis=axis)
4483+
if axis == 0:
4484+
result = self.loc[mask]
4485+
else:
4486+
result = self.loc[:, mask]
44844487

44854488
if inplace:
44864489
self._update_inplace(result)

0 commit comments

Comments
 (0)