I from itertools import permutations a=permutations(['1','4','5','6','7','9'],6)
This was done to obtain the results of a batch (by 6!) consisting of 1,4,5,6,7,9
I'm going to do this with numpy. But I don't know how to get it listed on numpy I'd appreciate it if you let me know
python
from itertools import permutations
import numpy as np
a=permutations(['1','4','5','6','7','9'],6)
b = np.array(list(a))
In [29]: b
Out[29]:
array([['1', '4', '5', '6', '7', '9'],
['1', '4', '5', '6', '9', '7'],
['1', '4', '5', '7', '6', '9'],
...,
['9', '7', '6', '4', '5', '1'],
['9', '7', '6', '5', '1', '4'],
['9', '7', '6', '5', '4', '1']],
dtype='<U1')
Are you talking about this?
© 2024 OneMinuteCode. All rights reserved.