Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add swap_coords to relevant 'See also' sections #2463

Merged
merged 1 commit into from
Oct 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions xarray/core/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ def assign_coords(self, **kwargs):
See also
--------
Dataset.assign
Dataset.swap_dims
"""
data = self.copy(deep=False)
results = self._calc_assign_results(kwargs)
Expand Down
5 changes: 5 additions & 0 deletions xarray/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,10 @@ def set_coords(self, names, inplace=False):
Returns
-------
Dataset

See also
--------
Dataset.swap_dims
"""
# TODO: allow inserting new coordinates with this method, like
# DataFrame.set_index?
Expand Down Expand Up @@ -2297,6 +2301,7 @@ def set_index(self, indexes=None, append=False, inplace=False,
See Also
--------
Dataset.reset_index
Dataset.swap_dims
"""
indexes = either_dict_or_kwargs(indexes, indexes_kwargs, 'set_index')
variables, coord_names = merge_indexes(indexes, self._variables,
Expand Down
1 change: 1 addition & 0 deletions xarray/core/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ def assign_coords(self, **kwargs):
See also
--------
Dataset.assign_coords
Dataset.swap_dims
"""
return self.apply(lambda ds: ds.assign_coords(**kwargs))

Expand Down