title: How to change pandas category type using a dtype dict?
body: <p>Instead of doing :</p>
  
  <pre><code>for col in df.columns : 
     df[col]= df[col].astype('category')
  </code></pre>
  
  <p>Am doing this :</p>
  
  <pre><code>dtype0= {'brand': np.dtype('int64'),
   'category': np.dtype('int64'),
   'chain': np.dtype('int64'),
   'company': np.dtype('int64'),
   'date': np.dtype('O'),
   'dept':  pandas.types.dtypes.CategoricalDtype,
   'id': np.dtype('int64')}
  
  df= df.astype(dtype0)
  </code></pre>
  
  <p>However, it does not work. Just wondering, how to change into category using the dictionnary.</p>