BitWiseCountOnes / Computation Layer

Count the number of set bits (1s) in each integer value. Similar to POPCNT instruction, C++'s std::popcount, or Python's bin(x).count('1').

For n-bit integers:

Applications:

  • Hamming weight calculation
  • Bit density analysis
  • Binary data validation
  • Flag state counting

Note: Result depends on the integer type width (8/16/32/64 bits).

Table
0
0
Table

Transforms

[, ...]

Select

column

The integer column to count set bits. Examples:

  • 0xFF (binary 11111111) → 8 ones
  • 0x0F (binary 00001111) → 4 ones
  • 0x55 (binary 01010101) → 4 ones

Must be an integer type column

Name for the new column. If not provided, the system generates a unique name. If AsColumn matches an existing column, the existing column is replaced. The name should follow valid column naming conventions.