Complete the code to stack the columns of the DataFrame into a Series.
stacked = df.[1]()The stack() method compresses columns into a single index level, turning columns into rows.
Complete the code to unstack the last level of the index in the Series.
unstacked = s.[1]()The unstack() method pivots the innermost index level to columns, reversing stack().
Fix the error in the code to correctly unstack the level named 'month'.
result = df.stack().[1]('month')
To move the 'month' index level back to columns, use unstack('month').
Fill both blanks to stack the DataFrame while dropping NaN values.
stacked = df.[1]([2]=True)
The stack(dropna=True) method stacks columns into rows while dropping any resulting NaN values.
Fill all three blanks to stack the DataFrame and then unstack the outermost index level (level 0).
result = df.[1]().[2]([3])
Chaining stack() followed by unstack(0) stacks columns to index then pivots the outermost index level back to columns.