Skip to content

A python function that returns whether an iterable has at least one True value. Also accounts for non-iterables as well.

Notifications You must be signed in to change notification settings

lakam99/any_iter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

any_iter

A python function that returns whether an iterable has at least one True value. Also accounts for non-iterables as well.

So far the test data returns:

      Empty data frame returns False
      Full data frame returns True
      Empty list returns False
      Full list returns True
      Empty list of lists returns False
      False list of lists returns True because at least one list is populated
      True list of lists returns True
      False list returns False
      Normal dict returns True
      False dict returns False
      True dict returns True
      Empty numpy array returns False
      Full numpy array returns True
      False numpy array returns False
      True numpy array returns True
      True returns True
      False returns False
      0 returns False
      0.6 returns True
      'Cat' returns True
      Blank string returns False

Feel free to modify test_cases.py to add additional test cases!

About

A python function that returns whether an iterable has at least one True value. Also accounts for non-iterables as well.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages