I am trying to work with big numpy matrix that generated with the following code:

np.full(np.repeat(2, 10), 1,dtype='int8')

and its shape is:

(2, 2, 2, 2, 2, 2, 2, 2, 2, 2)

but all values in that matrix equal one

there is any way to save each element in matrix in only one bit instead of byte ??

Note: I need that matrix as numpy matrix to can work with it further

1 Answers

Community On Best Solutions

There is not. It is caused by the computer architecture. It is possible to create some kind of wrapper to manage single bits, but you won't be able to use it as a normal numpy matrix then.