MCPcopy
hub / github.com/dask/dask / rename

Method rename

dask/dataframe/dask_expr/_collection.py:4481–4516  ·  view source on GitHub ↗

Alter Series index labels or name Function / dict values must be unique (1-to-1). Labels not contained in a dict / Series will be left as-is. Extra labels listed don't throw an error. Alternatively, change ``Series.name`` with a scalar value. Parameters

(self, index, sorted_index=False)

Source from the content-addressed store, hash-verified

4479 return SeriesGroupBy(self, by, **kwargs)
4480
4481 def rename(self, index, sorted_index=False):
4482 """Alter Series index labels or name
4483
4484 Function / dict values must be unique (1-to-1). Labels not contained in
4485 a dict / Series will be left as-is. Extra labels listed don't throw an
4486 error.
4487
4488 Alternatively, change ``Series.name`` with a scalar value.
4489
4490 Parameters
4491 ----------
4492 index : scalar, hashable sequence, dict-like or callable, optional
4493 If dict-like or callable, the transformation is applied to the
4494 index. Scalar or hashable sequence-like will alter the
4495 ``Series.name`` attribute.
4496 inplace : boolean, default False
4497 Whether to return a new Series or modify this one inplace.
4498 sorted_index : bool, default False
4499 If true, the output ``Series`` will have known divisions inferred
4500 from the input series and the transformation. Ignored for
4501 non-callable/dict-like ``index`` or when the input series has
4502 unknown divisions. Note that this may only be set to ``True`` if
4503 you know that the transformed index is monotonically increasing. Dask
4504 will check that transformed divisions are monotonic, but cannot
4505 check all the values between divisions, so incorrectly setting this
4506 can result in bugs.
4507
4508 Returns
4509 -------
4510 renamed : Series
4511
4512 See Also
4513 --------
4514 pandas.Series.rename
4515 """
4516 return new_collection(expr.RenameSeries(self, index, sorted_index))
4517
4518 def quantile(self, q=0.5, method="default"):
4519 """Approximate quantiles of Series

Callers 15

_divisionsMethod · 0.95
nameMethod · 0.95
ensure_fileFunction · 0.45
_renameFunction · 0.45
concat_pandasFunction · 0.45
_non_agg_chunkFunction · 0.45
_var_chunkFunction · 0.45
_var_aggFunction · 0.45
_cov_chunkFunction · 0.45
_mean_chunkFunction · 0.45

Calls 1

new_collectionFunction · 0.90

Tested by 15

test_merge_leftsemiFunction · 0.36
test_renameFunction · 0.36
test_are_co_alignedFunction · 0.36
test_categorizeFunction · 0.36
test_categorize_indexFunction · 0.36