title: How to convert values of panda dataframe to columns
body: <p>I have a dataset given below:</p>
  <pre><code>weekid type amount
  1       A    10   
  1       B    20
  1       C    30
  1       D    40
  1       F    50
  
  2       A    70
  2       E    80
  2       B    100
  </code></pre>
  <p>I am trying to convert it to another panda frame based on total number of type values defined with:</p>
  <pre><code>import pandas as pd
  import numpy as np
  
  df=pd.read_csv(INPUT_FILE)
  for type in df[&quot;type&quot;].unique():
      //todo
  </code></pre>
  <p>My aim is to get a data given below:</p>
  <pre><code>weekid type_A type_B type_C type_D type_E type_F
      1    10    20      30     40     0     50
      2    70    100     0      0      80    0   
  </code></pre>
  <p>Is there any specific function that convert unique values as a column and fills the missing values as 0 for each weekId groups? I am wondering that how this conversion can be done efficiently?</p>