Skip to content

Commit

Permalink
Adding docstring to Form.select_columns
Browse files Browse the repository at this point in the history
  • Loading branch information
tcawlfield committed Aug 21, 2024
1 parent 0949d5c commit fc48843
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/awkward/forms/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,19 @@ def columns(self, list_indicator=None, column_prefix=()):
def select_columns(
self, specifier, expand_braces=True, *, prune_unions_and_records: bool = True
):
"""
select_columns returns a new Form with only columns and sub-columns selected.
Returns an empty Form if no columns matched the specifier(s).
`specifier` can be a `str | Iterator[str | list[str] | tuple[str]]`.
Strings may include shell-globbing-style wildcards "*" and "?".
If `expand_braces` is `True` (the default), strings may include alternatives in braces.
For example, `["a.{b,c}.d"]` is equivalent to `["a.b.d", "a.c.d"]`.
Glob-style matching would also suit this single-character instance: `"a.[bc].d"`.
If specifier is a list which contains a list/tuple, that inner list will be interpreted as
column and subcolumn specifiers. They *may* contain wildcards, but "." will not be
interpreted as a `<field>.<subfield>` pattern.
"""
if isinstance(specifier, str):
specifier = {specifier}

Expand Down

0 comments on commit fc48843

Please sign in to comment.