home
search
help
profile
liking the experience? our app is even better
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now  
showing results for slice every n element in lists pandas
1def chunks(list_in, n):
2    # For item i in a range that is a length of l,
3    for i in range(0, len(list_in), n):
4        # Create an index range for l of n items:
5        yield list_in[i:i+n]
6# then just do this to get your output
7list(chunks(our_list, cut_every))
upvote
downvote