title: What is the syntax for pivot tables in Pandas? Docs don't seem to be right?
body: <p>I might be totally crazy, but I'm reading <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.pivot_table.html?highlight=pivot_table#pandas.DataFrame.pivot_table" rel="nofollow">the docs</a> for <code>pivot_table</code> in Pandas, and even <a href="http://pbpython.com/pandas-pivot-table-explained.html" rel="nofollow">some guides</a></p>
  
  <p>Literally using the example from the docs with my own data:</p>
  
  <pre><code>import pandas as pd
  
  df = pd.read_csv('data.csv')
  pivot_table(df, values='D', index=['A', 'B'], columns=['C'], aggfunc=np.sum)
  </code></pre>
  
  <p>Produces an error:</p>
  
  <blockquote>
    <p>pivot_table(df, values='D', index=['A', 'B'], columns=['C'], aggfunc=np.sum)
    NameError: name 'pivot_table' is not defined</p>
  </blockquote>
  
  <p>What am I doing wrong? Is there an additional import I need?</p>