Skip to content

Commit

Permalink
add docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
jschendel committed Oct 8, 2017
1 parent 697a760 commit a1f3279
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pandas/core/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,38 +223,44 @@ def _mut_exclusive(**kwargs):


def _not_none(*args):
"""Returns a generator consisting of the arguments that are not None"""
return (arg for arg in args if arg is not None)


def _any_none(*args):
"""Returns a boolean indicating if any argument is None"""
for arg in args:
if arg is None:
return True
return False


def _all_none(*args):
"""Returns a boolean indicating if all arguments are None"""
for arg in args:
if arg is not None:
return False
return True


def _any_not_none(*args):
"""Returns a boolean indicating if any argument is not None"""
for arg in args:
if arg is not None:
return True
return False


def _all_not_none(*args):
"""Returns a boolean indicating if all arguments are not None"""
for arg in args:
if arg is None:
return False
return True


def _count_not_none(*args):
"""Returns the count of arguments that are not None"""
return sum(x is not None for x in args)


Expand Down

0 comments on commit a1f3279

Please sign in to comment.