Tag: ‘object’
How to iterate over a JSON object in Python?
In this Python tutorial, we will learn about different ways to iterate over a JSON object. Agenda Introduction Iterate over JSON Object using the loads() method with for loop Iterate over JSON file using load() and for loop Summary Introduction JSON stands for Javascript object notation. Using JSON, we can store the data in key-value …
How to convert dtype ‘object’ to int in Pandas?
In this article, we will discuss multiple ways to convert any column with ‘object’ dtype to an integer in pandas. Table of Content Preparing dataset Approach 1: Using astype() function Approach 2: Using convert_dtypes() method Approach 3: Using pandas.to_numeric() function Summary Preparing dataset To quickly get started, let’s create a sample dataframe to experiment. We’ll …