Prepping for hilbert curve project

This commit is contained in:
Grant Sanderson
2015-12-13 15:41:45 -08:00
parent b2c5f71155
commit 399852a994
10 changed files with 57 additions and 381 deletions

View File

@ -214,7 +214,8 @@ def streth_array_to_length(nparray, length):
curr_len = len(nparray)
if curr_len > length:
raise Warning("Trying to stretch array to a length shorter than its own")
indices = np.arange(length)/ (float(length)/curr_len)
indices = np.arange(length)/ float(length)
indices *= curr_len
return nparray[indices.astype('int')]
def make_even(iterable_1, iterable_2):