Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.

Timeline for Pandas: DataFrame within DataFrame

Current License: CC BY-SA 3.0

7 events
when toggle format what by license comment
Jul 31, 2013 at 6:09 vote accept jorge.santos
Jul 31, 2013 at 6:09 vote accept jorge.santos
Jul 31, 2013 at 6:09
Jul 31, 2013 at 0:42 comment added Jeff you don't need to be that fancy df['scalar1'] = 234 will work
Jul 30, 2013 at 21:06 comment added jorge.santos Thank you Jeff. The idea of doing this is because I need to combine these data frames with another bunch of scalar values. For example row1: DF_a, np.nan, 104, 105 | row2: np.nan, DF_b, 234, 213. This assuming i have the columns Cat1, Cat2, Scalar1, Scalar2. i guess this still possible using the multi-index approach, would i just need to broadcast the scalar value across all items of cat1/cat2? thanks again
Jul 30, 2013 at 19:59 comment added Phillip Cloud There's also the option to create a hierarchically indexed DataFrame using Panel.to_frame(filter_observations=False).
Jul 30, 2013 at 19:32 history edited Jeff CC BY-SA 3.0
added 77 characters in body
Jul 30, 2013 at 19:17 history answered Jeff CC BY-SA 3.0