There's more...

All the parameters for the melt method are optional, and if you desire all your values to be in a single column and their old column labels to be in the other, you may call melt with just its defaults:

>>> state_fruit2.melt()

More realistically, you might have lots of variables that need melting and would like to specify only the identification variables. In that case, calling melt in the following manner will yield the same result as in step 2. You actually don't even need a list when melting a single column and can simply pass its string value:

>>> state_fruit2.melt(id_vars='State')
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset