MCPcopy
hub / github.com/dask/dask / reset_index

Method reset_index

dask/dataframe/dask_expr/_collection.py:659–679  ·  view source on GitHub ↗

Reset the index to the default index. Note that unlike in ``pandas``, the reset index for a Dask DataFrame will not be monotonically increasing from 0. Instead, it will restart at 0 for each partition (e.g. ``index1 = [0, ..., 10], index2 = [0, ...]``). This is due t

(self, drop: bool = False)

Source from the content-addressed store, hash-verified

657 self._expr = _expr
658
659 def reset_index(self, drop: bool = False):
660 """Reset the index to the default index.
661
662 Note that unlike in ``pandas``, the reset index for a Dask DataFrame will
663 not be monotonically increasing from 0. Instead, it will restart at 0
664 for each partition (e.g. ``index1 = [0, ..., 10], index2 = [0, ...]``).
665 This is due to the inability to statically know the full length of the
666 index.
667
668 For DataFrame with multi-level index, returns a new DataFrame with
669 labeling information in the columns under the index names, defaulting
670 to 'level_0', 'level_1', etc. if any are None. For a standard index,
671 the index name will be used (if set), otherwise a default 'index' or
672 'level_0' (if 'index' is already taken) will be used.
673
674 Parameters
675 ----------
676 drop : boolean, default False
677 Do not try to insert index into dataframe columns.
678 """
679 return new_collection(expr.ResetIndex(self, drop))
680
681 def head(self, n: int = 5, npartitions=1, compute: bool = True):
682 """First n rows of the dataset

Callers 15

idxmaxmin_combineFunction · 0.80
_mode_aggregateFunction · 0.80
assert_eqFunction · 0.80
group_split_pandasFunction · 0.80
concat_pandasFunction · 0.80
_cov_chunkFunction · 0.80
_metaMethod · 0.80
_metaMethod · 0.80
_calculate_divisionsFunction · 0.80
to_parquetFunction · 0.80
test_groupby_rollingFunction · 0.80

Calls 1

new_collectionFunction · 0.90