Python Pandas pivot()

Syntax pandas.pivot(data, index=None, columns=None, values=None) Return Value: The return value for the pivot() function is a reshaped DataFrame organized by index/column values. Background Direct quote from the Pandas Documentation website: This function does not support data aggregation. If there are multiple values, they will result in a Multi-Index in the columns. This article delves into … Read more

Python Pandas melt()

Syntax pandas.melt(frame, id_vars=None, value_vars=None, var_name=None, value_name=’value’, col_level=None, ignore_index=True) Return Value The return value for the melt() function is an unpivoted DataFrame. Background Direct quote from the Pandas Documentation website: “This function massages a DataFrame into a format where one or more columns are identifier variables (id_vars). While all other columns are considered measured variables (value_vars), … Read more

Reading and Writing JSON with Pandas

In this tutorial, we will learn how to transform a JSON object into a Pandas data frame and the other way around. For these approaches, we will have a look at the Pandas functions read_json() and to_json(). Working with JSON objects in Pandas is a very essential skill because we often find data stored in … Read more

Top 10 Python Libraries for E-commerce

In this article, we explore 10 Python libraries, platforms, tools, and frameworks that are useful for e-commerce. Criteria for the list included their relevance to e-commerce, popularity, the level of maintenance that is given to the code base, and their usefulness. We searched far and wide and narrowed down our search to the following: Saleor … Read more

Pandas loc() and iloc() – A Simple Guide with Video

In this tutorial, we are covering the Pandas functions loc() and iloc() which are used for data selection operations on dataframes. By using the loc() function, we access a group of rows and/or columns based on their respective labels, whereas the iloc() function is an integer-location-based way to access these groups. Getting values with the … Read more

The Pandas groupby() Method

In this tutorial, we will see what the Pandas groupby() method is and how we can use it on our datasets. Described in one sentence, the groupby() method is used to group our data and execute a function on the determined groups. It is especially useful to group a large amount of data and to … Read more