Pivoting a DataFrame in Pandas for output to CSV
This is a simple question for which answer are surprisingly difficult to find online. Here's the situation:

    >>> A
    [('hey', 'you', 4), ('hey', 'not you', 5), ('not hey', 'you', 2), ('not hey', 'not you', 6)]
    >>> A_p = pandas.DataFrame(A)
    >>> A_p
             0        1  2
    0      hey      you  4
    1      hey  not you  5
    2  not hey      you  2
    3  not hey  not you  6
    >>> B_p = A_p.pivot(0,1,2)
    >>> B_p
    1        not you  you
    0                    
    hey            5    4
    not hey        6    2

This isn't quite what's suggested in the documentation for pivot -- there, it shows results without the 1 and 0 in the upper-left-hand corner. And that's what I'm looking for, a DataFrame object that prints as

             not you  you
    hey            5    4
    not hey        6    2

The problem is that the normal behavior results in a csv file whose first line is

    0,not you,you

when I really want

    not you, you

When the normal csv file (with the preceding "0,") reads into R, it doesn't properly set the column and row names from the frame object, resulting in painful manual manipulation to get it in the right format. Is there a way to get pivot to give me a DataFrame object without that additional information in the upper-left corner?
Pivoting a DataFrame in Pandas for output to CSV
===

This is a simple question for which answer are surprisingly difficult to find online. Here's the situation:

    >>> A
    [('hey', 'you', 4), ('hey', 'not you', 5), ('not hey', 'you', 2), ('not hey', 'not you', 6)]
    >>> A_p = pandas.DataFrame(A)
    >>> A_p
             0        1  2
    0      hey      you  4
    1      hey  not you  5
    2  not hey      you  2
    3  not hey  not you  6
    >>> B_p = A_p.pivot(0,1,2)
    >>> B_p
    1        not you  you
    0                    
    hey            5    4
    not hey        6    2

This isn't quite what's suggested in the documentation for pivot -- there, it shows results without the 1 and 0 in the upper-left-hand corner. And that's what I'm looking for, a DataFrame object that prints as

             not you  you
    hey            5    4
    not hey        6    2

The problem is that the normal behavior results in a csv file whose first line is

    0,not you,you

when I really want

    not you, you

When the normal csv file (with the preceding "0,") reads into R, it doesn't properly set the column and row names from the frame object, resulting in painful manual manipulation to get it in the right format. Is there a way to get pivot to give me a DataFrame object without that additional information in the upper-left corner?