EN VI
Posts (0)
Questions (2)
2024-03-12 20:00:06
You could melt with ignore_index=False, then set the new variable column as index with set_index append=True: out = (data.melt(data.columns[:-3], ignore_index=False, var_name='tail') .set_i...
Tags: python pandas multi-index
2024-03-14 19:00:09
After pivot, the values don't have an index name, you have to assign it: (df.pivot(columns={'multi-1', 'multi-3'}, values=['multi-2']) .rename_axis(columns={None: 'multi-2'}) .reorder_levels(['m...
Tags: python pandas dataframe

Login


Forgot Your Password?

Create Account


Lost your password? Please enter your email address. You will receive a link to create a new password.

Reset Password

Back to login