\n",
"
\n",
@@ -2155,14 +2155,6 @@
" plot_lc(lc, nondet, title=oid)\n",
" print(f\"https://alerce.online/object/{oid}\")"
]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "ce797b850c4c2dd9",
- "metadata": {},
- "outputs": [],
- "source": []
}
],
"metadata": {
diff --git a/src/lsdb/catalog/catalog.py b/src/lsdb/catalog/catalog.py
index 6244f907..c8a202f1 100644
--- a/src/lsdb/catalog/catalog.py
+++ b/src/lsdb/catalog/catalog.py
@@ -123,6 +123,18 @@ def assign(self, **kwargs) -> Catalog:
Returns:
The catalog containing both the old columns and the newly created columns
+
+ Examples:
+ Create a new column using a function::
+
+ catalog = Catalog(...)
+ catalog = catalog.assign(new_col=lambda df: df['existing_col'] * 2)
+
+ Add a column from a 1-D Dask array:
+
+ import dask.array as da
+ new_data = da.arange(...)
+ catalog = catalog.assign(new_col=new_data)
"""
ddf = self._ddf.assign(**kwargs)
return Catalog(ddf, self._ddf_pixel_map, self.hc_structure)