Skip to content

Instantly share code, notes, and snippets.

Created April 12, 2013 22:35
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 anonymous/f9064e4c8790ae037ec6 to your computer and use it in GitHub Desktop.
Save anonymous/f9064e4c8790ae037ec6 to your computer and use it in GitHub Desktop.
Split array
data = range(15)
split_array = lambda _array, colums: \
[_array[i:i + colums] for i in \
xrange(0, len(_array), colums)]
print split_array(data, 5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment