October 2017
Intermediate to advanced
532 pages
16h 10m
English
The melt method is powerful and dramatically reshapes your DataFrame. It takes up to five parameters, with two of them being crucial to understanding how to reshape your data correctly:
The id_vars, or the identification variables, remain in the same column but repeat for each of the columns passed to value_vars. One crucial aspect of melt is that it ignores values in the index, and, in fact, it silently drops your index and replaces it with a default RangeIndex. This means that if you do have values in your index that you would like to keep, you will need ...
Read now
Unlock full access