Skip to content

Commit bda5d05

Browse files
committed
better readme example
1 parent f74416e commit bda5d05

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,12 @@ Allowing powerful and straightforward operations, like:
4646
```python
4747
# Compute the mean flux for each row of "object_nf"
4848
import numpy as np
49-
object_nf.map_rows(np.mean, "nested_sources.flux", row_container="args")
49+
50+
def mean_flux(row):
51+
"""Calculates the mean flux for each object"""
52+
return np.mean(row["nested_sources.flux"])
53+
54+
object_nf.map_rows(mean_flux, output_names="mean_flux")
5055
```
5156

5257
<p align="center">

0 commit comments

Comments
 (0)