| [ Web Proxy ] |
| Viewing: https://dataframes.bigquery.dev/reference/api/bigframes.bigquery.array_length.html | [Back] [Original] |
Section Navigation
Compute the length of each array element in the Series.
Examples:
>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> s = bpd.Series([[1, 2, 8, 3], [], [3, 4]])
>>> bbq.array_length(s)
0 4
1 0
2 2
dtype: Int64
You can call this function using the Series bigquery accessor.
>>> s.bigquery.array_length()
0 4
1 0
2 2
dtype: Int64
You can also use this accessor on a pandas Series after importing bigframes.
>>> import bigframes
>>> import pandas as pd
>>> ps = pd.Series([[1, 2, 8, 3], [], [3, 4]])
>>> ps.bigquery.array_length()
0 4
1 0
2 2
dtype: Int64
You can also apply this function directly to Series using apply.
>>> s.apply(bbq.array_length, by_row=False)
0 4
1 0
2 2
dtype: Int64
series (bigframes.series.Series) A Series with array columns.
the length of each element in the Series.
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 |