Skip to content

Instantly share code, notes, and snippets.

@ManishAradwad
Last active June 26, 2022 12:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ManishAradwad/46574efd2a141eba630e76e58417dcff to your computer and use it in GitHub Desktop.
Save ManishAradwad/46574efd2a141eba630e76e58417dcff to your computer and use it in GitHub Desktop.
Create uneven array
# cross = True if cross crease is wanted
def create_uneven_array(low, up, steps, spacing=1, cross=False):
span = up - low
dx = 1.0 / steps
if cross:
arr = np.array([low + (i*dx)**spacing*span for i in range(steps//2)])
return np.append(arr, arr[::-1])
else :
arr = np.array([low + (i*dx)**spacing*span for i in range(steps)])
return arr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment