Skip to content

Commit c29f7ee

Browse files
authored
Merge pull request #372 from lincc-frameworks/concat_example
Add a brief example of concatenating frames
2 parents f592cac + 0d7d1df commit c29f7ee

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

docs/tutorials/data_manipulation.ipynb

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,30 @@
317317
"ndf[\"nested.ab\"]"
318318
]
319319
},
320+
{
321+
"cell_type": "markdown",
322+
"metadata": {},
323+
"source": [
324+
"## Concatenating Nested Frames\n",
325+
"\n",
326+
"Users can concatenate two nested data frames using panda's `concat` function. Each row from each individual frame becomes a single row in the combined frame with the nested data correctly propagated."
327+
]
328+
},
329+
{
330+
"cell_type": "code",
331+
"execution_count": null,
332+
"metadata": {},
333+
"outputs": [],
334+
"source": [
335+
"from pandas import concat\n",
336+
"\n",
337+
"ndf_part1 = generate_data(5, 20, seed=1)\n",
338+
"ndf_part2 = generate_data(5, 20, seed=2)\n",
339+
"ndf_joined = concat([ndf_part1, ndf_part2], ignore_index=True)\n",
340+
"\n",
341+
"ndf_joined"
342+
]
343+
},
320344
{
321345
"cell_type": "markdown",
322346
"metadata": {},
@@ -370,7 +394,7 @@
370394
],
371395
"metadata": {
372396
"kernelspec": {
373-
"display_name": "lsdb",
397+
"display_name": "nested",
374398
"language": "python",
375399
"name": "python3"
376400
},
@@ -384,7 +408,7 @@
384408
"name": "python",
385409
"nbconvert_exporter": "python",
386410
"pygments_lexer": "ipython3",
387-
"version": "3.12.8"
411+
"version": "3.10.4"
388412
}
389413
},
390414
"nbformat": 4,

0 commit comments

Comments
 (0)