Skip to content
  • View menu
  • View sidebar

bioinfo core

Index & solution of bioInfo utilities

  • Home
  • All entries
  • Blogs
  • Contact
  • About

Categories

  • Between languages (7)
  • Blogs (8)
  • Python (35)
  • R (1)
  • Unix (37)

Tags

bedfile Blogs conda Excel html numpy Pandas Python R slurm Unix
07/21/202010/21/2021 by bioinfocore

Python if any or all True/False in a list

  • Python
  • Python
data = [False, False, False]

# Return any True in the list
any(data)

# Return any False in the list
not any(data)

# Same goes for all values True in the list
all(data)

Source:
https://stackoverflow.com/questions/31099561/test-if-all-elements-of-a-python-list-are-false/31099577

Post navigation

← Previous Post Python dictionary use value to get key
Next Post → Extract/subset bigwig file for a given genomic region
Copyright 2024 | by bioinfocore