binarify Function Reference

binarify(gt, L=0)

Transform an integer into a binary sequence on the L hypercube.

Parameters:
  • gt: integer representing a genotype
  • L: number of dimensions of the hypercube
Returns:
  • genotype: bool vector representing the same genotype

Examples:

In [1]: binarify(3, 5)
Out[1]: array([False, False, False,  True,  True], dtype=bool)

In [2]: FFPopSim.binarify(0b11, 5)
Out[2]: array([False, False, False,  True,  True], dtype=bool)       

Previous topic

tree_edge Class Reference

Next topic

integerify Function Reference

This Page