Skip to content

Instantly share code, notes, and snippets.

@irskep
Created November 24, 2010 02:42
Show Gist options
  • Save irskep/713006 to your computer and use it in GitHub Desktop.
Save irskep/713006 to your computer and use it in GitHub Desktop.
Multidimensional arrays in Python: missing since before you were born
def multidim_arr(*dims):
return [multidim_arr(*dims[1:]) for i in xrange(dims[0])] if dims else 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment