Converting string of hex values to numpy array of specific shape
You can simplify bin(...)[2:].zfill(columns) to f'{...:0&gt;{columns}b}'.

This can use f'{int(row[:2], 16):0&gt;{columns}b}'.
I'd recommend you convert to a NumPy array out of the function, as it's not really that important to be in there.
Your code isn't idiomatic, as Python uses snake_case not camelCase.


def from_hex(values, columns):
    return [
        list(f'{int(row[:2], 16):0&gt;{columns}b}')
        for row in values.split("\n")
    ]