[SciPy-User] adding dataframes to a Panel

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[SciPy-User] adding dataframes to a Panel

Pierre Bicou
Hi,

I'm not sure i'm on the right mailing list but I need some help with Pandas. 
Yes, i'm a newbie with numerical python, so be indulgent plz.

I have a non empty dataframe: df = pd.DataFrame(...)
and an empty panel : p = pd.Panel()

I want to add "df" to "p", with index "1234", like this : p["1234"] = data

This doesn't seem to work, I get an empty dataframe at p["1234"].

Why ?


Thx,
P

_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: adding dataframes to a Panel

Paul Hobson-2
You want [hidden email]

but I think the answer to your questions is p.loc['1234'] = data

I don't work with Panel much, so caveat emptor, I guess.

On Mon, Sep 15, 2014 at 8:14 AM, Pierre Bicou <[hidden email]> wrote:
Hi,

I'm not sure i'm on the right mailing list but I need some help with Pandas. 
Yes, i'm a newbie with numerical python, so be indulgent plz.

I have a non empty dataframe: df = pd.DataFrame(...)
and an empty panel : p = pd.Panel()

I want to add "df" to "p", with index "1234", like this : p["1234"] = data

This doesn't seem to work, I get an empty dataframe at p["1234"].

Why ?


Thx,
P

_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user



_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user