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)
| 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 |