Skip to content

Commit e903683

Browse files
committed
improve programmatic example
1 parent 7cb9ce9 commit e903683

File tree

1 file changed

+2
-2
lines changed
  • src/nested_pandas/nestedframe

1 file changed

+2
-2
lines changed

src/nested_pandas/nestedframe/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2088,9 +2088,9 @@ def map_rows(
20882088
the nested column name and all sub-columns will be available:
20892089
20902090
>>> def first_val(row):
2091-
... return (row[key][0] for key in row.keys())
2091+
... return {"first_"+key.split(".")[1]:row[key][0] for key in row.keys()}
20922092
2093-
>>> nf.map_rows(first_val, columns="nested", output_names=["first_t", "first_flux", "first_band"])
2093+
>>> nf.map_rows(first_val, columns="nested")
20942094
first_t first_flux first_band
20952095
0 8.383890 31.551563 r
20962096
1 13.704390 68.650093 g

0 commit comments

Comments
 (0)