You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In [25]: df.reset_index().pivot('index','name','value')
Out[25]:
name p temp
index
2014-01-01 101 10.0
2014-01-02 100 11.5
That said, I think it could simply use the index (though their IS a bit of ambiguity as even in this simple case (after the reset) its an integer index).
pull requests are welcome for an enhancement like this.
Hello,
I have a Pandas DataFrame
df
like this:I wanted to get a new DataFrame
df2
like:I did this:
but it raises
cannot label index with a null key
I need to do this
see http://stackoverflow.com/questions/26101246/spread-data-across-multiple-columns
In my mind, passing index parameter shouldn't be necessary when applying pivot function in such a case.
Kind regards
The text was updated successfully, but these errors were encountered: