[ Web Proxy ]
URL:
Viewing: https://dataframes.bigquery.dev/reference/api/bigframes.pandas.Index.from_frame.html [Back]  [Original]

bigframes.pandas.Index.from_frame — bigframes documentation
Back to top
Search the docs ...:

bigframes.pandas.Index.from_frame#

classmethod Index.from_frame(frame: Series | DataFrame) Index[source]#

Make a MultiIndex from a DataFrame.

Examples:

>>> df = bpd.DataFrame([['HI', 'Temp'], ['HI', 'Precip'],
...                     ['NJ', 'Temp'], ['NJ', 'Precip']],
...                    columns=['a', 'b'])
>>> df
    a       b
0  HI    Temp
1  HI  Precip
2  NJ    Temp
3  NJ  Precip

[4 rows x 2 columns]
>>> bpd.MultiIndex.from_frame(df)
Index([0, 1, 2, 3], dtype='Int64')
Parameters:

frame (Union[bigframes.pandas.Series, bigframes.pandas.DataFrame]) bigframes.pandas.Series or bigframes.pandas.DataFrame to convert to bigframes.pandas.Index.

Returns:

The Index representation of the given Series or DataFrame.

Return type:

bigframes.pandas.Index

Raises:

bigframes.exceptions.NullIndexError If Index is Null.


Web Proxy Viewer  |  New URL  |  Original Page