Level up your control flow game with these advanced tricks

In a recent article I introduced the fundamentals of control flow in Python programming to readers. These critical skills instruct your programs on which sections of code to run, giving you the power to perform the calculations that you need to perform for different circumstances.

That said, the techniques listed in the article were quite basic and left some efficiency off the table. It was called the fundamentals of control flow after all.

Since that article only covered the basics, I’ll now introduce you to some useful tricks that improve the speed, flexibility, and readability of your control flow processes…


Learn the fundamentals of making your code do what you want it to do

Python has become a favorite programming language among the scientific and data science communities. The relatively easy to understand syntax, open nature of the community, and availability of many useful packages all make it a very attractive language. This has lead to many people, myself included, wanting to become experts in Python to improve our career opportunities.

In order to write scientific Python scripts, you must know how to have your program make decisions. This leads to the concept of control flow.

What is control flow?

“In computer science, control flow (or flow of control) is the order in which individual statements, instructions or…


Image credit: Elliot Alderson from Pixabay, https://unsplash.com/s/photos/dystopian

Last year was inarguably the best year of my life. Society shutting down finally gave me the opportunity to live my life the way I wanted, away from judgemental eyes. Here are all the bucket list items that I used to enhance my life, all thanks to the pandemic:

Be the hero in a dystopian fantasy

The virus was spreading. Every interaction was a chance at infection. No, Covid-19 isn’t the zombie virus, but I was able to pretend. I finally got the chance to live through a pseudo-zombie-pocalypse. I had to prepare. In case of economic collapse I bought a lifetime supply of toilet paper. To…


An in-depth tutorial in using bokeh to impress your boss and clients

Data science is really all about communication. Those of us who are interested in the subject spend our time learning new numerical methods, learning about how to manipulate data, and learning how to create regressions to draw conclusions from the data set.

But none of that is worth anything if you can’t communicate the results.

This is why I argue that data science is really about communication. The most important part is conveying the conclusions from your data analysis in a way that convinces other people to listen to what you have to say.

Since most people don’t want to…


1000x Faster is Now Available!

The cover of 1000x Faster

Before diving in, I want to make sure I’m being fully straightforward with you. This article is shameless self-promotion. I’ve recently published my book, 1000x Faster: How to Automate Laboratory Data Analysis with Python, and I think you might want to know how it can help your life. If you do, excellent. If you don’t, there’s no need to read on.

What’s the inspiration behind 1000x Faster?

To be honest, I don’t like doing data analysis. You sit at a computer, you open a spreadsheet, you type some calculations and maybe generate some plots, then you move on to the next spreadsheet to do it again…


Or why publishing one article is more profitable than publishing one article

Connecting the dots between your passive income content — Image credit: geralt at Pixabay

Anybody who creates and sells content as a form of passive income what’s to know how to earn more money from the content they create. I’m sure that’s no surprise to you; anybody who invests their time in something wants to have as big of an impact as possible, and make as much profit from it as possible.

Medium is full of articles talking about how we can have that impact by writing more, and more, and more. If we commit to creating new passive income sources every day we get better at creating those products. …


The momentum of passive income erupts as a beautiful fountain

Image credit: Tristan Gevaux at Unsplash

Many of us are chasing passive income in our lives. It’s why we write articles on Medium, sell books or courses online, buy and rent out real estate, and invest in the stock market. We dream of the day when we can live off our prior accomplishments instead of needing to constantly achieve new things to pay our bills.

“If you don’t find a way to make money while you sleep, you will work until you die.” — Warren Buffet

I’ve been building my passive income sources for five years now. I write articles on Medium covering topics like data…


Bonus: Putting in less effort causes it to work better!

Image credit: Micheile Henderson at Unsplash

I’ll be very open, direct, and honest about it. I want to make more money. I want to have more money available to spend on travel, to buy a nice house, to have the financial freedom to reduce hours at work and spend more time playing with friends and family.

I bet you do too.

There are a number of different things I’ve done to make more money. I’ve gotten better at the work I do. I’ve seen to it that all my projects at work are delivered on time and on budget. I’ve taken on extra responsibilities at work…


Reflections from Taking Stanford’s Leading Innovation Course

Image credit: jarmoluk at pixabay

We’re all here because we’re interested in entrepreneurship, and innovation. That’s what draws us to the articles in this publication. Maybe we want to be the next Nikolai Tesla, Steve Jobs, or Elon Musk. Or maybe we have smaller visions, and dream of working independently, crafting professional identities based on our skills and our relationships.

I’ve had dreams of being self-employed for years now. For many years it was simply a dream that I didn’t act on. Eventually I started trying a number of different side hustles. While living in Italy I helped researchers publish their papers in English. I…


Reflections on what I learned from Stanford’s Leading Innovation course

Image credit: jarmoluk at pixabay

We’re all here because we’re interested in entrepreneurship, and innovation. That’s what draws us to the articles in this publication. Maybe we want to be the next Nikolai Tesla, Steve Jobs, or Elon Musk. Or maybe we have smaller visions, and dream of working independently, crafting professional identities based on our skills and our relationships.

Building an leading an innovative team is really hard.

I’ve had dreams of building a research team for years now. My vision is to create a culture where people are excited to come to work…

Peter Grant

Pioneering a new research department at Beyond Efficiency. I write about building science, data science, marketing and leadership.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store