Add sequence numbers - Deepstash

Explore the World's Best Ideas

Join today and uncover 100+ curated journeys from 50+ topics. Unlock access to our mobile app with extensive features.

Add sequence numbers

Add sequence numbers

Assume you have three lists and you want to turn them into a table-like structure, where each row has a numeric ID.

You can combine count() with zip() to add sequence numbers to the resulting tuples. See code in image.

3

26 reads

MORE IDEAS ON THIS

itertools.count(start=0, step=1)

Returns an infinite iterator that produces evenly spaced values starting with number start.

It's often used in combination with map() to generate consecutive data points, and with zip() to add sequence numbers.

4

50 reads

CURATED FROM

CURATED BY

ocpodariu

Alt account of @ocp. I use it to stash ideas about software engineering

🐍 Exploring itertools docs

More like this

Writing a book: Getting started

  1. Decide what the book is about. Write the argument of your book in a sentence, then turn that into a paragraph, then into a one-page outline. Then write a table of contents to help guide your writing. Break each chapter into a few sections.
  2. Set a daily word ...

Budgeting your money is the cornerstone of a sound financial plan, and seeing all the numbers in black and white can offer valuable perspective on where your mone...

WES MOSS

Answers To Common Interview Questions

Answers To Common Interview Questions

  1. Can you tell me a little bit about yourself? Don’t tell your life story; answer clearly and concisely. Focus on professional accomplishments.
  2. Why should we hire you over the other applicants? Say, “I don’t know the skill of others, but I do my own,” then highlight your strengths and ...

Read & Learn

20x Faster

without
deepstash

with
deepstash

with

deepstash

Access to 200,000+ ideas

Access to the mobile app

Unlimited idea saving & library

Unlimited history

Unlimited listening to ideas

Downloading & offline access

Personalized recommendations

Supercharge your mind with one idea per day

Enter your email and spend 1 minute every day to learn something new.

Email

I agree to receive email updates