Python get class name: This tutorial will explain you how to get the name of a python class. What is a Python Class ? In python language, a class is the only way to define new types specific to the programmer. It is quite possible to do without classes to write a computer program. Their… Continue reading How to Get Class Name of an Instance in Python
Category: Learning
Pandas Get Dummies (One-Hot Encoding) – pd.get_dummies()
Pandas Get Dummies: This tutorial will explain how to use the pd.get_dummies() function which allows you to easily one-hot encode your categorical data. What does One-Hot encoding mean? As a data scientist or data analyst, you often work with algorithms that cannot handle categorical data (like random forest for example). Basically, these are variables that… Continue reading Pandas Get Dummies (One-Hot Encoding) – pd.get_dummies()
How to Check Numpy Version in Your Python Script?
Check numpy Version: This article will detail the different methods to check the version of NumPy installed on your Python environment. Numpy Python Module The Python module numpy is a very powerful mathematical library that is used to perform various analyses and many packages are dependent on numpy (such as the Pandas module). It is often… Continue reading How to Check Numpy Version in Your Python Script?
How to Get and Change the Current Working Directory in Python?
Python change working directory: This article will detail how to get the current working directory and how to change the working directory in python. How are the directories defined? For beginners in programming, a directory is nothing more or less than a folder. These directories are contained in the root (often noted C:/ or D:/… Continue reading How to Get and Change the Current Working Directory in Python?
How to Check Pandas Version in Your Python Script?
Check Pandas Version: This article will explain you how to get the version of pandas directly in a python code or with the package installer called pip. What is the Pandas Library? Pandas is a Python library primarily used for data analysis. It is very popular and has a very active community of contributors. Pandas… Continue reading How to Check Pandas Version in Your Python Script?
How to Create a List of Numbers in Python
List of Numbers Python: In this tutorial, we will see how to create a list of numbers in python. Introduction The Python language does not only work with variables. They also use lists of variables. A list is a sequence of elements numbered from 0. To generate a list of numbers or elements, there are… Continue reading How to Create a List of Numbers in Python
Python fromtimestamp: Get the date from a timestamp – Datetime.fromtimestamp()
Python fromtimestamp: In this article, we will learn how to compute the data corresponding to a given timestamp. Python fromtimestamp In a database, it is common to store the date and time as a timestamp. The Unix time also called Unix Timestamp is a measure of time based on the number of seconds elapsed since… Continue reading Python fromtimestamp: Get the date from a timestamp – Datetime.fromtimestamp()
How to Compute the Natural Logarithm (ln) in Python
Natural log python: In this tutorial we will see how to compute the natural logarithm using the math and numpy libraries. Introduction The natural logarithm (often abbreviated ln) is the inverse of the exponential function. It is often used in mathematics for calculations involving time and growth rates. In python, several libraries allow us to… Continue reading How to Compute the Natural Logarithm (ln) in Python
How to Convert an Image to Grayscale Using Python
Convert an image to grayscale: In this article, we will see how to grayscale an image. Introduction Grayscaling is a process of converting an image from different color spaces (RGB, HSV for example) into shades of gray ranging from complete black to complete white. Greyscaling is a process often used for : Dimension reduction: in… Continue reading How to Convert an Image to Grayscale Using Python
How to Generate a Random Number Between 0 and 1 in Python
We will see in this article how to generate a random number between 0 and 1 in python Introduction In the python language, there is a random module that is used to generate different random numbers. In this module, many methods are defined to generate random numbers with different datatypes. Here are the methods that… Continue reading How to Generate a Random Number Between 0 and 1 in Python