comnum.pack_symbols#
- comnum.pack_symbols(bits, m)#
Pack bits into symbols of
mbits, the most significant first.- Parameters:
bits (array_like) – a multiple of
mbits.m (int) – bits per symbol, 1 to 16.
- Returns:
the symbols (int64).
- Return type:
- Raises:
ValueError – for an invalid parameter or input (the message names it).
Examples
>>> import comnum >>> comnum.pack_symbols([1, 0, 1, 1, 1, 1, 0, 0], 4).tolist() [11, 12]