bigframes.pandas.DatetimeIndex.from_frame#

classmethod DatetimeIndex.from_frame(frame: Series | DataFrame) Index#

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.