Python Numpy 101: How to Calculate the Row Variance of a Numpy 2D Array?

You can play with the following interactive Python code to calculate the variance of a 2D array (total, row, and column variance). Here’s another practical example: What is the output of this puzzle?*Advanced Level* (solution below) Numpy is a popular Python library for data science focusing on arrays, vectors, and matrices. This puzzle introduces a … Read more

How do You Slice and Index Multidimensional Arrays in Numpy?

Python’s library for data science, NumPy, allows you to slice multidimensional arrays easily. For multi-dimensional slices, you can use one-dimensional slicing for each axis separately. You define the slices for each axis, separated by a comma. Here are a few examples drawn from my comprehensive NumPy tutorial. Take your time to thoroughly understand each of … Read more

What is a Career in Computer Programming Like?

All programming is not created equal. Having said this, I don’t know a single programmer who regrets his choice of learning to program. With growing automation, programming becomes more and more a skill that is at the heart of many tasks in our society. No matter whether you work in the medicine, logistics, retail, or … Read more

How Python Freelancing Helped Me Create a Thriving Coding Business on the Side

I’m a full-time online business owner working in the Python education space. But I started my career by working as a doctoral computer science researcher at the University of Stuttgart, Germany. While I was working there, I started my online business by finishing a few Python freelancing jobs. Creating a side-business helped me greatly in … Read more

Upwork vs Fiverr — Where to Sell Your Freelancing Services as a Coder?

So you want to participate in the booming “gig economy” creating an additional income stream by working from home? Members of my Python Freelancer Course ask this question a lot: what’s the best marketplace to sell your coding skills: Upwork.com or Fiverr.com? This is a multi-dimensional decision problem, but I have a clear preference. Read … Read more

How Do You Deal with International Sales Taxes when Creating Your Online Course with Teachable, Podia, or Thrive Apprentice?

I am not an attorney and this should not be taken as legal advice. It’s just based on my experience as a course creator. Teachable does not collect state sales taxes for you. They also don’t collect taxes for all international sales. If a user from Japan buys your course, you are responsible for paying … Read more

Why Does the Scikit-learn Library use a Trailing Underscore Convention for Attribute Names?

If you’ve used the sklearn library in your own code, you may have realized that all attributes are suffixed with a trailing underscore. Here’s an example for the k-means algorithm: In the second-last line, we used the kmeans attribute cluster_centers_. Why does sklearn library not use the attribute name cluster_centers? ‘The short answer is, the … Read more