Skip to content

Python

Pandas Replace NaN with Zeroes Cover Image

Pandas: Replace NaN with Zeroes

Working with missing data is an essential skill for any data analyst or data scientist! In many cases, you’ll want to replace your missing data, or NaN values, with zeroes. In this tutorial, you’ll learn how to use Pandas to

Python If-Else Statements with Multiple Conditions Cover Image

Python If-Else Statements with Multiple Conditions

Conditional statements, or if-else statements, allow you to control the flow of your code. Understanding the power of if-else statements allows you to become a stronger Python programmer. This is because they allow you to execute only certain parts of

Python String startswith Check if String Starts With Substring Cover Image

Python String startswith: Check if String Starts With Substring

The Python startswith method is used to check if a string starts with a specific substring. In this tutorial, you’ll learn how to use the Python startswith function to evaluate whether a string starts with one or more substrings. Being

Python String endswith Check if String Ends With Substring Cover Image

Python String endswith: Check if String Ends With Substring

The Python endswith method is used to check if a string ends with a specific substring. In this tutorial, you’ll learn how to use the Python endswith method to evaluate whether a string ends with one or more substrings. Being

How to Get File Size in Python in Bytes, KB, MB, and GB Cover Image

How to Get File Size in Python in Bytes, KB, MB, and GB

When working with files programmatically, you’ll often want to know how large a file is. This can be helpful when transferring files or copying files. Python provides a number of built-in methods of doing this, including using the os and

How to Convert JSON to CSV in Python Cover Image

How to Convert JSON to CSV in Python

JavaScript Object Notation (JSON) is one of the most common formats you’ll encounter when working with data – especially web data. Being able to convert the format into other formats, such as CSV, is an important skill. In this tutorial,

How to Round to 2 Decimal Places in Python

How to Round to 2 Decimal Places in Python

Being able to work with and round floating point values, or decimal values, in Python is an important skill. In this tutorial, you’ll learn how to round to decimal places in Python, including learning how to round up or down.

Python Scientific Notation Converting and Suppressing Cover Image

Python Scientific Notation: Converting and Suppressing

Python allows you to work with floating point values in standard notations and scientific notation. In this tutorial, you’ll learn how to use scientific notation to convert and suppress floating point values to and from scientific notation. Scientific notation refers

How to Remove First or Last Character From a Python String Cover Image

How to Remove First or Last Character From a Python String

Working with strings is an essential skill for a Python developer of any skill level. In many cases, this means cleaning strings, such as trimming either the front or end of a string. In this tutorial, you’ll learn how to

NumPy Best Ways to Map a Function Over an Array Cover Image

NumPy: Best Ways to Map a Function Over an Array

In this tutorial, you’ll learn how to use NumPy to map a function over an array using different methods such as NumPy vectorize. Being able to apply the same function to each element in an array is an important skill.