How to Split a String Between Numbers and Letters?

Problem Formulation: Given a string of letters and numbers. How to split the string into substrings of either letters or numbers by using the boundary between a letter and a number and vice versa. Examples: Have a look at the following examples of what you want to accomplish. ‘111A222B333C’ —> [‘111’, ‘A’, ‘222’, ‘B’, ‘333’, … Read more

NumPy Average

NumPy is a popular Python library for data science focusing on arrays, vectors, and matrices. It’s at the core of data science and machine learning in Python. In today’s article, you’ll going to master NumPy’s impressive average() function that will be a loyal friend to you when fighting your upcoming data science battles. average(a, axis=None, … Read more

How to Get the Duration of a Video in Python?

Problem Formulation: Given a video file. How to get its duration in seconds using Python code? The video can have any of the following video formats: MP4 AVI Flash Video Mov Method 1: Using Subprocess + ffprobe Within your Python shell, you can run any external command with the module subprocess. The external tool ffprobe … Read more

NumPy Dot Product

Numpy is a popular Python library for data science focusing on arrays, vectors, and matrices. An important application of arrays, matrices, and vectors is the dot product. This article will teach you everything you need to know to get started! The dot product behaves differently for different input arrays. Dot Product 1D array and Scalar … Read more

Python ord() Function

The Python ord() function takes a character (=string of length one) as an input and returns the Unicode number of this character. For example, ord(‘a’) returns the Unicode number 97. The inverse function of ord() is the chr() function, so chr(ord(‘a’)) returns the original character ‘a’. Here are three examples of passed Unicode characters transformed … Read more

How to Use Dash Within a Jupyter Notebook?

Problem Formulation: Can you serve a dash app within a Jupyter notebook rather than in a browser? Answer: Yes! Plotly created two Github projects that enable the serving of dash apps in a Jupyter notebook. The older jupyterlab-dash project is not actively maintained according to its creators from Plotly. You should use have a look … Read more

They Use These 15+ Python Interview Questions To Fail You … (And What You Can Do About It)

Fear Your Coding Interview? This article shows you how to make your coding interview a success. General Tips to Prepare Your Interview Watch the following Instagram post and learn about popular Python interview questions (swipe left, swipe right): Sieh dir diesen Beitrag auf Instagram an [CHALLENGE] How many of the three questions can you answer? … Read more

Python min() — A Simple Illustrated Guide

The min() function returns the minimum of the provided arguments. As arguments, you can either pass a number of comma-separated values, or a single iterable. An optional key function argument allows you to customize the calculation of the minimum by explicitly defining the weight of each value in the iterable that is used as a … Read more

Python max() — A Simple Illustrated Guide

The max() function returns the maximum of the provided arguments. You can pass either an arbitrary number of values, comma-separated, or an iterable as arguments. An optional key function argument allows you to customize the calculation of the maximum by explicitly defining the weight of each value in the iterable that is used as a … Read more