@@ -316,7 +316,7 @@ def _to_dataset_whole(self, name=None, shallow_copy=True):
316316 if name in self .coords :
317317 raise ValueError ('cannot create a Dataset from a DataArray with '
318318 'the same name as one of its coordinates' )
319- # use private APIs here for speed: this is called by _to_temp_dataset(),
319+ # use private APIs for speed: this is called by _to_temp_dataset(),
320320 # which is used in the guts of a lot of operations (e.g., reindex)
321321 variables = self ._coords .copy ()
322322 variables [name ] = self .variable
@@ -428,9 +428,9 @@ def to_index(self):
428428 def dims (self ):
429429 """Tuple of dimension names associated with this array.
430430
431- Note that the type of this property is inconsistent with `Dataset.dims`.
432- See `Dataset.sizes` and `DataArray.sizes` for consistently named
433- properties.
431+ Note that the type of this property is inconsistent with
432+ `Dataset.dims`. See `Dataset.sizes` and `DataArray.sizes` for
433+ consistently named properties.
434434 """
435435 return self .variable .dims
436436
@@ -868,12 +868,11 @@ def reindex(self, method=None, tolerance=None, copy=True, **indexers):
868868 Maximum distance between original and new labels for inexact
869869 matches. The values of the index at the matching locations most
870870 satisfy the equation ``abs(index[indexer] - target) <= tolerance``.
871- Requires pandas>=0.17.
872871 **indexers : dict
873872 Dictionary with keys given by dimension names and values given by
874- arrays of coordinates tick labels. Any mis-matched coordinate values
875- will be filled in with NaN, and any mis-matched dimension names will
876- simply be ignored.
873+ arrays of coordinates tick labels. Any mis-matched coordinate
874+ values will be filled in with NaN, and any mis-matched dimension
875+ names will simply be ignored.
877876
878877 Returns
879878 -------
@@ -943,8 +942,8 @@ def swap_dims(self, dims_dict):
943942 return self ._from_temp_dataset (ds )
944943
945944 def expand_dims (self , dim , axis = None ):
946- """Return a new object with an additional axis (or axes) inserted at the
947- corresponding position in the array shape.
945+ """Return a new object with an additional axis (or axes) inserted at
946+ the corresponding position in the array shape.
948947
949948 If dim is already a scalar coordinate, it will be promoted to a 1D
950949 coordinate consisting of a single value.
@@ -970,16 +969,17 @@ def expand_dims(self, dim, axis=None):
970969 return self ._from_temp_dataset (ds )
971970
972971 def set_index (self , append = False , inplace = False , ** indexes ):
973- """Set DataArray (multi-)indexes using one or more existing coordinates.
972+ """Set DataArray (multi-)indexes using one or more existing
973+ coordinates.
974974
975975 Parameters
976976 ----------
977977 append : bool, optional
978978 If True, append the supplied index(es) to the existing index(es).
979979 Otherwise replace the existing index(es) (default).
980980 inplace : bool, optional
981- If True, set new index(es) in-place. Otherwise, return a new DataArray
982- object.
981+ If True, set new index(es) in-place. Otherwise, return a new
982+ DataArray object.
983983 **indexes : {dim: index, ...}
984984 Keyword arguments with names matching dimensions and values given
985985 by (lists of) the names of existing coordinates or variables to set
@@ -988,7 +988,7 @@ def set_index(self, append=False, inplace=False, **indexes):
988988 Returns
989989 -------
990990 obj : DataArray
991- Another dataarray, with this dataarray's data but replaced coordinates.
991+ Another dataarray, with this data but replaced coordinates.
992992
993993 See Also
994994 --------
@@ -1607,9 +1607,9 @@ def from_series(cls, series):
16071607 """Convert a pandas.Series into an xarray.DataArray.
16081608
16091609 If the series's index is a MultiIndex, it will be expanded into a
1610- tensor product of one-dimensional coordinates (filling in missing values
1611- with NaN). Thus this operation should be the inverse of the `to_series`
1612- method.
1610+ tensor product of one-dimensional coordinates (filling in missing
1611+ values with NaN). Thus this operation should be the inverse of the
1612+ `to_series` method.
16131613 """
16141614 # TODO: add a 'name' parameter
16151615 name = series .name
@@ -2089,16 +2089,16 @@ def quantile(self, q, dim=None, interpolation='linear', keep_attrs=False):
20892089 numpy.nanpercentile, pandas.Series.quantile, Dataset.quantile
20902090 """
20912091
2092- ds = self ._to_temp_dataset ().quantile (q , dim = dim , keep_attrs = keep_attrs ,
2093- interpolation = interpolation )
2092+ ds = self ._to_temp_dataset ().quantile (
2093+ q , dim = dim , keep_attrs = keep_attrs , interpolation = interpolation )
20942094 return self ._from_temp_dataset (ds )
20952095
20962096 def rank (self , dim , pct = False , keep_attrs = False ):
20972097 """Ranks the data.
20982098
20992099 Equal values are assigned a rank that is the average of the ranks that
2100- would have been otherwise assigned to all of the values within that set.
2101- Ranks begin at 1, not 0. If pct is True , computes percentage ranks.
2100+ would have been otherwise assigned to all of the values within that
2101+ set. Ranks begin at 1, not 0. If pct, computes percentage ranks.
21022102
21032103 NaNs in the input array are returned as NaNs.
21042104
0 commit comments