title: After using Dask pivot_table I lose the index column
body: <p>I am loosing index column after I use pivot_table for Dask Dataframe and save data to Parquet file.</p>
  
  <pre><code>import dask.dataframe as dd
  import pandas as pd
  
  df=pd.DataFrame()
  df["Index"]=[1,2,3,1,2,3]
  df["Field"]=["A","A","A","B","B","B"]
  df["Value"]=[10,20,30,100,120,130]
  df
  </code></pre>
  
  <p>My dataframe:</p>
  
  <pre><code>   Index Field  Value
  0      1     A     10
  1      2     A     20
  2      3     A     30
  3      1     B    100
  4      2     B    120
  5      3     B    130
  </code></pre>
  
  <p>Dask code:</p>
  
  <pre><code>ddf=dd.from_pandas(df,2)
  ddf=ddf.categorize("Field")
  ddf=ddf.pivot_table(values="Value", index="Index", columns="Field")
  dd.to_parquet("1.parq",ddf)
  dd.read_parquet("1.parq").compute()
  </code></pre>
  
  <p>This gives an error:</p>
  
  <blockquote>
    <p>ValueError: Multiple possible indexes exist: ['A', 'B'].  Please
    select one with index='index-name'</p>
  </blockquote>
  
  <p>I can select A or B as index, but I am missing the Index column.</p>
  
  <p>I tried <code>dd.to_parquet("1.parq",ddf, write_index=True)</code>, but it gives me the following error:</p>
  
  <blockquote>
    <p>TypeError: cannot insert an item into a CategoricalIndex that is not
    already an existing category</p>
  </blockquote>
  
  <p>Can someone help me save the table with the column "Index" into the Parquet file? </p>
  
  <p>PS:</p>
  
  <p><code>ddf.pivot_table(values="Value", index="Index", columns="Field").compute()</code> gives result as expected:</p>
  
  <pre><code>Field     A      B
  Index             
  1      10.0  100.0
  2      20.0  120.0
  3      30.0  130.0
  </code></pre>
  
  <p>And using Pandas is not a solution, because my data is 20 GB.</p>
  
  <p>EDIT:</p>
  
  <p>I tried </p>
  
  <pre><code>ddf.columns = list(ddf.columns)
  dd.to_parquet("1.parq",ddf, write_index=True)
  </code></pre>
  
  <p>And it gives me a new error:</p>
  
  <blockquote>
    <p>dask.async.TypeError: expected list of bytes</p>
  </blockquote>
  
  <p>Google shows that those kind of errors arise from Tornado asynchronous library.</p>