The pandas library has a huge API that provides many ways of transforming data. In this chapter, we’ll cover some of the most powerful and most popular ways to transform data in pandas.
Pivot and pivot table
Pivot and pivot
table are very popular and particularly attractive to beginners because they are so powerful. However, their powerfulness comes at a performance cost. While pivot is a great tool for initially transforming the DataFrame as part of a data normalization step, it should not be used frequently throughout the data analysis phase. Listing
5-1 shows an example of using ...