modin.pandas.DatetimeIndex.to_frame¶
- DatetimeIndex.to_frame(index: bool = True, name: Hashable | None = _NoDefault.no_default) modin.pandas.DataFrame[source]¶
Create a
DataFramewith a column containing the Index.- Parameters:
index (bool, default True) – Set the index of the returned
DataFrameas the original Index.name (object, defaults to index.name) – The passed name should substitute for the index name (if it has one).
- Returns:
DataFramecontaining the original Index data.- Return type:
See also
Index.to_seriesConvert an Index to a Series.
Series.to_frameConvert Series to DataFrame.
Examples
By default, the original Index is reused. To enforce a new Index:
To override the name of the resulting column, specify name: