Hi Folks
How recreated a integer list with generator?
import random
tmp = []
for x in range(0,600):
tmp.append(random.randint(0,5000))
tmp = list(set(tmp))
tmp.sort()
Should be possible recreated this list using same magic math formula
or numpy array?
Can I create a generator? How?
Wh
Hi Mr. Goodman
Thanks a lot. Works Fine
Reagards
Mario Moura
2010/12/27 Keith Goodman :
> On Mon, Dec 27, 2010 at 10:36 AM, Mario Moura wrote:
>> Hi Folks
>>
>> a = np.zeros((4,3,5,55,5),dtype='|S8')
>> myLen = 4 # here I use myLen = len(something)
&g
7;,'bar','hello','world'])
# But I cant contruct by hand like this
a[3,2,4,:4,4] = fillMe
a
Again. I need construct custom slice from here
tmpIndex = tuple(li) + sl + 4
a[tmpIndex]
Who can help me?
Best Regards
Mario Moura
_
Hi Folks
Is it possible some example how deal with strides with combinations, let see:
>>> from numpy import *
>>> import itertools
>>> dt = dtype('i,i,i')
>>> a = fromiter(itertools.combinations(range(10),3), dtype=dt, count=-1)
>>> a
array([(0, 1, 2), (0, 1, 3), (0, 1, 4), (0, 1, 5), (0, 1, 6),
Hi Mr. Weckesser
Thanks a lot!
Works fine!
Regards
Mario
2010/12/3 Warren Weckesser :
>
>
> On Fri, Dec 3, 2010 at 6:31 AM, Mario Moura wrote:
>>
>> Hi Folks
>>
>> I have this situation
>>
>> >>> from timeit import Timer
>> >&g
Hi Folks
I have this situation
>>> from timeit import Timer
>>> reps = 5
>>>
>>> t = Timer('itertools.combinations(range(1,10),3)', 'import itertools')
>>> print sum(t.repeat(repeat=reps, number=1)) / reps
1.59740447998e-05
>>> t = Timer('itertools.combinations(range(1,100),3)', 'import itertools