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

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.

STASHED IN:

2

🐍 Exploring itertools docs

STASHED IN:

0 Comments

MORE IDEAS FROM Python's Infinite Count Generator

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.

STASHED IN:

2

Deepstash helps you become inspired, wiser and productive, through bite-sized ideas from the best articles, books and videos out there.

GET THE APP:

RELATED IDEA

Performing Under Pressure

It is often said that moderate pressure makes people perform better. The Yerkes-Dodson Law of psychology states that a given task needs an ideal level of motivation or arousal.

Too much or too little psychological activation can hinder the implementation of the task. Any challenge would also appear stressful and a burden on us if it is imposed without our consent or intrinsic interest.

6

STASHED IN:

141

Saturn

Saturn is the sixth planet from the Sun and the second largest planet in our solar system. Adorned with a dazzling system of icy rings, Saturn is unique among the planets. It is not the only planet to have rings, but none are as spectacular or as complex as Saturn's. Like fellow gas giant Jupiter, Saturn is a massive ball made mostly of hydrogen and helium.

Surrounded by more than 60 known moons, Saturn is home to some of the most fascinating landscapes in our solar system. From the jets of water that spray from Enceladus to the methane lakes on smoggy Titan, the Saturn system is a rich source of scientific discovery and still holds many mysteries.

The farthest planet from Earth discovered by the unaided human eye, Saturn has been known since ancient times. The planet is named for the Roman god of agriculture and wealth, who was also the father of Jupiter.

1

STASHED IN:

21

Digital Wellness: The Ideal State

We need to know how to balance the way digital technologies are embedded in every aspect of our life and turn towards digital wellness where we:

  • Connect in meaningful ways with our loved ones and colleagues.
  • Find flow in our work, living in harmony with our digital and physical environment.
  • Enjoy great relationships both online and offline.
  • Use technology intentionally, not being addicted to it.
  • Learn how to manage your digital privacy.
  • Savour the pleasant experiences in the real world.
  • Have a sense of self-efficacy.

2

STASHED IN:

214