MCPcopy Create free account
hub / github.com/dask/dask / reset_index

Method reset_index

dask/dataframe/dask_expr/_collection.py:693–713  ·  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

691 self._expr = _expr
692
693 def reset_index(self, drop: bool = False):
694 """Reset the index to the default index.
695
696 Note that unlike in ``pandas``, the reset index for a Dask DataFrame will
697 not be monotonically increasing from 0. Instead, it will restart at 0
698 for each partition (e.g. ``index1 = [0, ..., 10], index2 = [0, ...]``).
699 This is due to the inability to statically know the full length of the
700 index.
701
702 For DataFrame with multi-level index, returns a new DataFrame with
703 labeling information in the columns under the index names, defaulting
704 to 'level_0', 'level_1', etc. if any are None. For a standard index,
705 the index name will be used (if set), otherwise a default 'index' or
706 'level_0' (if 'index' is already taken) will be used.
707
708 Parameters
709 ----------
710 drop : boolean, default False
711 Do not try to insert index into dataframe columns.
712 """
713 return new_collection(expr.ResetIndex(self, drop))
714
715 def head(self, n: int = 5, npartitions=1, compute: bool = True):
716 """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