Loading tutorials
[] and loc, and have used groupby with aggregations such as sum. Here you will learn how melt converts a wide table into a long one.3 min read[], and have seen melt turn columns into rows. Here you will learn the four arguments that decide what melt keeps, what it stacks, and what it calls the results.2 min readmelt to go from wide to long. Here you go the other way: pivot takes values stored in rows and spreads them across new columns.2 min readmelt and pivot do on their own. Here you will check that they undo each other. You will also see which details change along the way: column order, row order, and the index.2 min readmelt and pivot from the earlier chapters, and that you can use groupby with sum. It covers the most common pivot error and how to fix it.2 min readgroupby with sum and count, and know what pivot does. It also assumes you have seen pivot fail on duplicate keys. pivot_table handles those duplicates by aggregating them.2 min readpivot_table with index, columns, values and aggfunc, and that you know how groupby aggregation works. It covers two options of pivot_table: fill_value for empty cells and margins for totals.2 min read[] and loc, and use groupby with aggregation functions such as sum and count. Earlier chapters covered pivot_table. Here you learn to read the column labels it sometimes produces.2 min readpivot_table and know what a MultiIndex is from the previous chapter. A reshaped table often has labels that are awkward to use. The row keys sit in the index instead of in columns. The column labels may have two levels, and the columns axis may carry a leftover2 min readgroupby, reset_index, and how a MultiIndex (an index with more than one level) looks when printed. melt and pivot work on columns. stack and unstack do the same job on index levels, which is useful after a groupby has already put your keys into the index.2 min readmelt, the meaning of id_vars, and how to reset an index. You should also be comfortable with a regular expression such as \w+.2 min readpivot_table, groupby, and how to select DataFrame columns. Here you will build a frequency table with pd.crosstab. It counts how often each pair of category values occurs.2 min read