How to Check Your TensorFlow Version in Colab?

To check your TensorFlow version in your Jupyter Notebook such as Google’s Colab, use the following two commands: import tensorflow as tf This imports the TensorFlow library and stores it in the variable named tf. print(tf.__version__) This prints the installed TensorFlow version number in the format x.y.z. The following code example uses the dunder attribute … Read more

How to Check the Pandas Version in Your Script?

What is the Pandas Library? The pandas library provides data structures and functionality to represent and manipulate labelled and tabular data. Think of it as like an advanced spreadsheet program in your code with functionality includingβ€”but not limited to: creating spreadsheets, accessing individual rows by name, calculating basic statistics over rows and columns, and summing … Read more

Inheritance in Python

You have the eyes of your mother. One could say, you “inherited” the eyes of your mother. As you may have guessed, this article is about inheritance in Python. Inheritance is one of the most important features of object orientation. It’s a simple and intuitive concept but even advanced coders circumvent using inheritance because they … Read more

[FANG KILLER ICP] Will the Internet Computer Disrupt Big Tech?

What is the Internet Computer? The Internet Computer is blockchain technology and computing infrastructure initiated by the non-profit organization DFinity. Like the public Internet, the Internet Computer is a distributed computing platform consisting of thousands of connected and decentralized servers that host backend software. This idea mitigates the increasing monopolization of Internet services and enables … Read more

Python Single vs Double Underscore (_ vs __)

The single underscore in Python “_” is used to either make a variable different from a Python keyword such as in float_=8, or to indicate that it should be used in a private context such as in _var=8. The double underscore in Python “__” (called “dunder“) is used to make an instance attribute or method … Read more

How to Check if the Current Time is in a Range in Python?

Problem Formulation Given a timestamp x such as the current time and a time interval marked with start and end timestamps. Goal: Create a function that checks whether the given timestamp falls in the interval [start, end], so that x>=start and x<=end. Constraints: If the interval is empty when start >= end and x != … Read more

Python Pass Statement

The pass statement does nothing when executed. You can use it as a placeholder for future code so that you can focus on the high-level structure first and implement the details later. For example, functions, loops, class definitions, or if statements require at least one statement in their indentation block. Think of the pass statement … Read more

How to Get the Size of a String in Python?

Problem Formulation: Given a string my_string. Find the number of characters of the string! For example, the string “what is my length?” must yield integer 18 because it has 18 characters. Here are three examples of our desired outputs: Solution: Before we dive into alternatives, here’s the quick answer to this question. To get the … Read more