copapy.to_byte#

copapy.to_byte(x)#

Convert the elements of an array to bytes, limited to the range 0 to 255. Floats are truncated towards zero, nan is converted to 0.

Parameters:

x (array[Any]) – Array

Return type:

array[int]

Returns:

x as byte array