Skip to content

Commit 9fa21d8

Browse files
committed
Delete variables after last use to save memory
1 parent 14329ff commit 9fa21d8

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

tutorials/parquet-catalog-demos/wise-allwise-catalog-demo.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,11 @@ pandas_df = pd.read_parquet(
165165
pandas_df.describe()
166166
```
167167

168+
```{code-cell} ipython3
169+
# Delete pandas_df to save memory. This is useful when running on a machine with a small amount of RAM.
170+
del pandas_df
171+
```
172+
168173
## Example 2: Pyarrow with advanced filters (color-color cuts for AGN)
169174

170175
+++
@@ -240,6 +245,12 @@ colorbar_norm = colors.LogNorm(vmin=1, vmax=10) # for an all-sky search, use vm
240245
pyarrow_df.plot.hexbin("w3w4", "w1w2", norm=colorbar_norm)
241246
```
242247

248+
```{code-cell} ipython3
249+
# Delete variables to save memory. This is useful when running on a machine with a small amount of RAM.
250+
del pyarrow_ds
251+
del pyarrow_df
252+
```
253+
243254
## Example 3: Nearest-neighbor search (using pyarrow and astropy)
244255

245256
+++
@@ -311,6 +322,12 @@ neighbors_df = pyarrow_ds.to_table(
311322
neighbors_df
312323
```
313324

325+
```{code-cell} ipython3
326+
# Delete variables to save memory. This is useful when running on a machine with a small amount of RAM.
327+
del pyarrow_ds
328+
del neighbors_df
329+
```
330+
314331
## Schema Access
315332

316333
+++

0 commit comments

Comments
 (0)