Replies: 1 comment 2 replies
-
import numpy as np
import pandas as pd
import dask.dataframe as dd
col = pd.MultiIndex.from_product([['foo', 'bar'], ['a','b','c']])
df = pd.DataFrame(np.random.rand(5,6))
df.columns = col
df.index = ["k", "l", "m", "n", "o"]
print(df.melt(ignore_index=False)) # Want this
dask_df = dd.from_pandas(df, npartitions=1)
print(dask_df.melt().compute())
print(dask_df.melt(ignore_index=False).compute()) # this will throw saying ignore_index does not exist |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In latest pandas version, looks like there is an ignore_index argument that can be set to False to keep index, is there any way to melt while keeping index in Dask?
Beta Was this translation helpful? Give feedback.
All reactions