If you want that the output of the code is generated automatically, then you have to change ``.. code-block::`` to ``.. ipython::``, and leave out the `>>>` (the ipthon_directive, see http://pandas.pydata.org/pandas-docs/stable/contributing.html#about-the-pandas-documentation).

Off course you can also use `code-block`, but then you need to paste the exact console input and output in there.