bigframes.pandas.Index.from_frame#
- classmethodIndex.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 b0 HI Temp1 HI Precip2 NJ Temp3 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 convertto bigframes.pandas.Index.
- Returns:
The Index representation of the given Series or DataFrame.
- Return type:
- Raises:
bigframes.exceptions.NullIndexError – If Index is Null.
On this page