Understanding the basic methods to manipulate your data

I remember playing a lot with modeling clay and bricks when I was little.

What I loved the most was not the toys themselves, but the fun of building and shaping things with small parts.

I was fascinated by the fact that two bricks only fit together if you put them in the right position.

And from there, you can build whatever you want.

As a grown-up data scientist, I find that working with data has some of that magic.

You can have a lot of features for your analysis. But you’ll only discover the patterns you are looking for when you put them in the proper format.

P

andas is an open-source library that allows data scientists to work with high-performance, easy-to-use data structures, and data analysis tools in Python. Its core data structure is the DataFrame, in which data is represented in a tabular form with labeled rows and columns.

The data might come organized in different formats, as we’ll mention in a moment. Not all of them are suitable for the analysis we want to perform.

Fortunately, Pandas allows us to change the structure of the DataFrame in multiple ways. But first of all, we need to understand the concept of shape before explaining how these changes work.

Shape refers to how a dataset is organized in rows and columns.

#dataframes #pandas #data-analysis #pandas-dataframe #data-manipulation

How to Reshape a Pandas DataFrame
2.05 GEEK