| [ Web Proxy ] |
| Viewing: https://dataframes.bigquery.dev/reference/api/bigframes.pandas.api.typing.StructAccessor.field.html | [Back] [Original] |
Section Navigation
Extract a child field of a struct as a Series.
Examples:
>>> import bigframes.pandas as bpd
>>> s = bpd.Series(
... [
... {"version": 1, "project": "pandas"},
... {"version": 2, "project": "pandas"},
... {"version": 1, "project": "numpy"},
... ],
... dtype=bpd.ArrowDtype(pa.struct(
... [("version", pa.int64()), ("project", pa.string())]
... ))
... )
Extract by field name.
>>> s.struct.field("project")
0 pandas
1 pandas
2 numpy
Name: project, dtype: string
Extract by field index.
>>> s.struct.field(0)
0 1
1 2
2 1
Name: version, dtype: Int64
name_or_index Name (str) or index (int) of the child field to extract.
The data corresponding to the selected child field.
Copyright 2019, Google.
Created using Sphinx 8.1.3.
Built with the PyData Sphinx Theme 0.19.0.
| Web Proxy Viewer | New URL | Original Page |