repo
stringlengths
7
54
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
20
28.4k
docstring
stringlengths
1
46.3k
docstring_tokens
listlengths
1
1.66k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
1 value
summary
stringlengths
4
350
obf_code
stringlengths
7.85k
764k
pydata/xarray
xarray/core/dataset.py
Dataset.unstack
def unstack(self, dim=None): """ Unstack existing dimensions corresponding to MultiIndexes into multiple new dimensions. New dimensions will be added at the end. Parameters ---------- dim : str or sequence of str, optional Dimension(s) over which to ...
python
def unstack(self, dim=None): """ Unstack existing dimensions corresponding to MultiIndexes into multiple new dimensions. New dimensions will be added at the end. Parameters ---------- dim : str or sequence of str, optional Dimension(s) over which to ...
[ "def", "unstack", "(", "self", ",", "dim", "=", "None", ")", ":", "if", "dim", "is", "None", ":", "dims", "=", "[", "d", "for", "d", "in", "self", ".", "dims", "if", "isinstance", "(", "self", ".", "get_index", "(", "d", ")", ",", "pd", ".", ...
Unstack existing dimensions corresponding to MultiIndexes into multiple new dimensions. New dimensions will be added at the end. Parameters ---------- dim : str or sequence of str, optional Dimension(s) over which to unstack. By default unstacks all Mult...
[ "Unstack", "existing", "dimensions", "corresponding", "to", "MultiIndexes", "into", "multiple", "new", "dimensions", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L2681-L2724
train
Unstacks existing dimensions corresponding to MultiIndexes into multiple new dimensions.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/dataset.py
Dataset.update
def update(self, other, inplace=None): """Update this dataset's variables with those from another dataset. Parameters ---------- other : Dataset or castable to Dataset Dataset or variables with which to update this dataset. inplace : bool, optional If Tru...
python
def update(self, other, inplace=None): """Update this dataset's variables with those from another dataset. Parameters ---------- other : Dataset or castable to Dataset Dataset or variables with which to update this dataset. inplace : bool, optional If Tru...
[ "def", "update", "(", "self", ",", "other", ",", "inplace", "=", "None", ")", ":", "inplace", "=", "_check_inplace", "(", "inplace", ",", "default", "=", "True", ")", "variables", ",", "coord_names", ",", "dims", "=", "dataset_update_method", "(", "self", ...
Update this dataset's variables with those from another dataset. Parameters ---------- other : Dataset or castable to Dataset Dataset or variables with which to update this dataset. inplace : bool, optional If True, merge the other dataset into this dataset in-pl...
[ "Update", "this", "dataset", "s", "variables", "with", "those", "from", "another", "dataset", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L2726-L2752
train
Update this dataset s variables with those from another dataset.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/dataset.py
Dataset.merge
def merge(self, other, inplace=None, overwrite_vars=frozenset(), compat='no_conflicts', join='outer'): """Merge the arrays of two datasets into a single dataset. This method generally not allow for overriding data, with the exception of attributes, which are ignored on the second ...
python
def merge(self, other, inplace=None, overwrite_vars=frozenset(), compat='no_conflicts', join='outer'): """Merge the arrays of two datasets into a single dataset. This method generally not allow for overriding data, with the exception of attributes, which are ignored on the second ...
[ "def", "merge", "(", "self", ",", "other", ",", "inplace", "=", "None", ",", "overwrite_vars", "=", "frozenset", "(", ")", ",", "compat", "=", "'no_conflicts'", ",", "join", "=", "'outer'", ")", ":", "inplace", "=", "_check_inplace", "(", "inplace", ")",...
Merge the arrays of two datasets into a single dataset. This method generally not allow for overriding data, with the exception of attributes, which are ignored on the second dataset. Variables with the same name are checked for conflicts via the equals or identical methods. Pa...
[ "Merge", "the", "arrays", "of", "two", "datasets", "into", "a", "single", "dataset", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L2754-L2810
train
Merge two set of exception - related datasets into a single dataset.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/dataset.py
Dataset.drop
def drop(self, labels, dim=None): """Drop variables or index labels from this dataset. Parameters ---------- labels : scalar or list of scalars Name(s) of variables or index labels to drop. dim : None or str, optional Dimension along which to drop index l...
python
def drop(self, labels, dim=None): """Drop variables or index labels from this dataset. Parameters ---------- labels : scalar or list of scalars Name(s) of variables or index labels to drop. dim : None or str, optional Dimension along which to drop index l...
[ "def", "drop", "(", "self", ",", "labels", ",", "dim", "=", "None", ")", ":", "if", "utils", ".", "is_scalar", "(", "labels", ")", ":", "labels", "=", "[", "labels", "]", "if", "dim", "is", "None", ":", "return", "self", ".", "_drop_vars", "(", "...
Drop variables or index labels from this dataset. Parameters ---------- labels : scalar or list of scalars Name(s) of variables or index labels to drop. dim : None or str, optional Dimension along which to drop index labels. By default (if ``dim is No...
[ "Drop", "variables", "or", "index", "labels", "from", "this", "dataset", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L2820-L2846
train
Drop variables or index labels from this dataset.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/dataset.py
Dataset.drop_dims
def drop_dims(self, drop_dims): """Drop dimensions and associated variables from this dataset. Parameters ---------- drop_dims : str or list Dimension or dimensions to drop. Returns ------- obj : Dataset The dataset without the given dime...
python
def drop_dims(self, drop_dims): """Drop dimensions and associated variables from this dataset. Parameters ---------- drop_dims : str or list Dimension or dimensions to drop. Returns ------- obj : Dataset The dataset without the given dime...
[ "def", "drop_dims", "(", "self", ",", "drop_dims", ")", ":", "if", "utils", ".", "is_scalar", "(", "drop_dims", ")", ":", "drop_dims", "=", "[", "drop_dims", "]", "missing_dimensions", "=", "[", "d", "for", "d", "in", "drop_dims", "if", "d", "not", "in...
Drop dimensions and associated variables from this dataset. Parameters ---------- drop_dims : str or list Dimension or dimensions to drop. Returns ------- obj : Dataset The dataset without the given dimensions (or any variables contai...
[ "Drop", "dimensions", "and", "associated", "variables", "from", "this", "dataset", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L2856-L2885
train
Drop dimensions and associated variables from this dataset.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/dataset.py
Dataset.transpose
def transpose(self, *dims): """Return a new Dataset object with all array dimensions transposed. Although the order of dimensions on each array will change, the dataset dimensions themselves will remain in fixed (sorted) order. Parameters ---------- *dims : str, optiona...
python
def transpose(self, *dims): """Return a new Dataset object with all array dimensions transposed. Although the order of dimensions on each array will change, the dataset dimensions themselves will remain in fixed (sorted) order. Parameters ---------- *dims : str, optiona...
[ "def", "transpose", "(", "self", ",", "*", "dims", ")", ":", "if", "dims", ":", "if", "set", "(", "dims", ")", "^", "set", "(", "self", ".", "dims", ")", ":", "raise", "ValueError", "(", "'arguments to transpose (%s) must be '", "'permuted dataset dimensions...
Return a new Dataset object with all array dimensions transposed. Although the order of dimensions on each array will change, the dataset dimensions themselves will remain in fixed (sorted) order. Parameters ---------- *dims : str, optional By default, reverse the d...
[ "Return", "a", "new", "Dataset", "object", "with", "all", "array", "dimensions", "transposed", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L2887-L2925
train
Return a new Dataset object with all array dimensions transposed.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/dataset.py
Dataset.dropna
def dropna(self, dim, how='any', thresh=None, subset=None): """Returns a new dataset with dropped labels for missing values along the provided dimension. Parameters ---------- dim : str Dimension along which to drop missing values. Dropping along multiple...
python
def dropna(self, dim, how='any', thresh=None, subset=None): """Returns a new dataset with dropped labels for missing values along the provided dimension. Parameters ---------- dim : str Dimension along which to drop missing values. Dropping along multiple...
[ "def", "dropna", "(", "self", ",", "dim", ",", "how", "=", "'any'", ",", "thresh", "=", "None", ",", "subset", "=", "None", ")", ":", "# TODO: consider supporting multiple dimensions? Or not, given that", "# there are some ugly edge cases, e.g., pandas's dropna differs", ...
Returns a new dataset with dropped labels for missing values along the provided dimension. Parameters ---------- dim : str Dimension along which to drop missing values. Dropping along multiple dimensions simultaneously is not yet supported. how : {'any', ...
[ "Returns", "a", "new", "dataset", "with", "dropped", "labels", "for", "missing", "values", "along", "the", "provided", "dimension", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L2927-L2980
train
Returns a new dataset with dropped labels for missing values along the provided dimension.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/dataset.py
Dataset.fillna
def fillna(self, value): """Fill missing values in this object. This operation follows the normal broadcasting and alignment rules that xarray uses for binary arithmetic, except the result is aligned to this object (``join='left'``) instead of aligned to the intersection of inde...
python
def fillna(self, value): """Fill missing values in this object. This operation follows the normal broadcasting and alignment rules that xarray uses for binary arithmetic, except the result is aligned to this object (``join='left'``) instead of aligned to the intersection of inde...
[ "def", "fillna", "(", "self", ",", "value", ")", ":", "if", "utils", ".", "is_dict_like", "(", "value", ")", ":", "value_keys", "=", "getattr", "(", "value", ",", "'data_vars'", ",", "value", ")", ".", "keys", "(", ")", "if", "not", "set", "(", "va...
Fill missing values in this object. This operation follows the normal broadcasting and alignment rules that xarray uses for binary arithmetic, except the result is aligned to this object (``join='left'``) instead of aligned to the intersection of index coordinates (``join='inner'``). ...
[ "Fill", "missing", "values", "in", "this", "object", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L2982-L3009
train
Fill missing values in this object with the given value.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/dataset.py
Dataset.interpolate_na
def interpolate_na(self, dim=None, method='linear', limit=None, use_coordinate=True, **kwargs): """Interpolate values according to different methods. Parameters ---------- dim : str Specifies the dimension along which to interpol...
python
def interpolate_na(self, dim=None, method='linear', limit=None, use_coordinate=True, **kwargs): """Interpolate values according to different methods. Parameters ---------- dim : str Specifies the dimension along which to interpol...
[ "def", "interpolate_na", "(", "self", ",", "dim", "=", "None", ",", "method", "=", "'linear'", ",", "limit", "=", "None", ",", "use_coordinate", "=", "True", ",", "*", "*", "kwargs", ")", ":", "from", ".", "missing", "import", "interp_na", ",", "_apply...
Interpolate values according to different methods. Parameters ---------- dim : str Specifies the dimension along which to interpolate. method : {'linear', 'nearest', 'zero', 'slinear', 'quadratic', 'cubic', 'polynomial', 'barycentric', 'krog', 'pchip', ...
[ "Interpolate", "values", "according", "to", "different", "methods", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L3011-L3058
train
Interpolate values along a specified dimension.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/dataset.py
Dataset.ffill
def ffill(self, dim, limit=None): '''Fill NaN values by propogating values forward *Requires bottleneck.* Parameters ---------- dim : str Specifies the dimension along which to propagate values when filling. limit : int, default None ...
python
def ffill(self, dim, limit=None): '''Fill NaN values by propogating values forward *Requires bottleneck.* Parameters ---------- dim : str Specifies the dimension along which to propagate values when filling. limit : int, default None ...
[ "def", "ffill", "(", "self", ",", "dim", ",", "limit", "=", "None", ")", ":", "from", ".", "missing", "import", "ffill", ",", "_apply_over_vars_with_dim", "new", "=", "_apply_over_vars_with_dim", "(", "ffill", ",", "self", ",", "dim", "=", "dim", ",", "l...
Fill NaN values by propogating values forward *Requires bottleneck.* Parameters ---------- dim : str Specifies the dimension along which to propagate values when filling. limit : int, default None The maximum number of consecutive NaN values ...
[ "Fill", "NaN", "values", "by", "propogating", "values", "forward" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L3060-L3083
train
Fill NaN values by propogating values forward
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/dataset.py
Dataset.bfill
def bfill(self, dim, limit=None): '''Fill NaN values by propogating values backward *Requires bottleneck.* Parameters ---------- dim : str Specifies the dimension along which to propagate values when filling. limit : int, default None ...
python
def bfill(self, dim, limit=None): '''Fill NaN values by propogating values backward *Requires bottleneck.* Parameters ---------- dim : str Specifies the dimension along which to propagate values when filling. limit : int, default None ...
[ "def", "bfill", "(", "self", ",", "dim", ",", "limit", "=", "None", ")", ":", "from", ".", "missing", "import", "bfill", ",", "_apply_over_vars_with_dim", "new", "=", "_apply_over_vars_with_dim", "(", "bfill", ",", "self", ",", "dim", "=", "dim", ",", "l...
Fill NaN values by propogating values backward *Requires bottleneck.* Parameters ---------- dim : str Specifies the dimension along which to propagate values when filling. limit : int, default None The maximum number of consecutive NaN values...
[ "Fill", "NaN", "values", "by", "propogating", "values", "backward" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L3085-L3108
train
Fill NaN values by propogating values backward filling.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/dataset.py
Dataset.combine_first
def combine_first(self, other): """Combine two Datasets, default to data_vars of self. The new coordinates follow the normal broadcasting and alignment rules of ``join='outer'``. Vacant cells in the expanded coordinates are filled with np.nan. Parameters ---------- ...
python
def combine_first(self, other): """Combine two Datasets, default to data_vars of self. The new coordinates follow the normal broadcasting and alignment rules of ``join='outer'``. Vacant cells in the expanded coordinates are filled with np.nan. Parameters ---------- ...
[ "def", "combine_first", "(", "self", ",", "other", ")", ":", "out", "=", "ops", ".", "fillna", "(", "self", ",", "other", ",", "join", "=", "\"outer\"", ",", "dataset_join", "=", "\"outer\"", ")", "return", "out" ]
Combine two Datasets, default to data_vars of self. The new coordinates follow the normal broadcasting and alignment rules of ``join='outer'``. Vacant cells in the expanded coordinates are filled with np.nan. Parameters ---------- other : DataArray Used to ...
[ "Combine", "two", "Datasets", "default", "to", "data_vars", "of", "self", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L3110-L3127
train
Combine two Datasets default to data_vars of self.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/dataset.py
Dataset.reduce
def reduce(self, func, dim=None, keep_attrs=None, numeric_only=False, allow_lazy=False, **kwargs): """Reduce this dataset by applying `func` along some dimension(s). Parameters ---------- func : function Function which can be called in the form `f(...
python
def reduce(self, func, dim=None, keep_attrs=None, numeric_only=False, allow_lazy=False, **kwargs): """Reduce this dataset by applying `func` along some dimension(s). Parameters ---------- func : function Function which can be called in the form `f(...
[ "def", "reduce", "(", "self", ",", "func", ",", "dim", "=", "None", ",", "keep_attrs", "=", "None", ",", "numeric_only", "=", "False", ",", "allow_lazy", "=", "False", ",", "*", "*", "kwargs", ")", ":", "if", "dim", "is", "ALL_DIMS", ":", "dim", "=...
Reduce this dataset by applying `func` along some dimension(s). Parameters ---------- func : function Function which can be called in the form `f(x, axis=axis, **kwargs)` to return the result of reducing an np.ndarray over an integer valued axis. dim ...
[ "Reduce", "this", "dataset", "by", "applying", "func", "along", "some", "dimension", "(", "s", ")", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L3129-L3200
train
Reduces this Dataset by applying func along some dimension.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/dataset.py
Dataset.apply
def apply(self, func, keep_attrs=None, args=(), **kwargs): """Apply a function over the data variables in this dataset. Parameters ---------- func : function Function which can be called in the form `func(x, *args, **kwargs)` to transform each DataArray `x` in th...
python
def apply(self, func, keep_attrs=None, args=(), **kwargs): """Apply a function over the data variables in this dataset. Parameters ---------- func : function Function which can be called in the form `func(x, *args, **kwargs)` to transform each DataArray `x` in th...
[ "def", "apply", "(", "self", ",", "func", ",", "keep_attrs", "=", "None", ",", "args", "=", "(", ")", ",", "*", "*", "kwargs", ")", ":", "# noqa", "variables", "=", "OrderedDict", "(", "(", "k", ",", "maybe_wrap_array", "(", "v", ",", "func", "(", ...
Apply a function over the data variables in this dataset. Parameters ---------- func : function Function which can be called in the form `func(x, *args, **kwargs)` to transform each DataArray `x` in this dataset into another DataArray. keep_attrs : bo...
[ "Apply", "a", "function", "over", "the", "data", "variables", "in", "this", "dataset", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L3202-L3250
train
Apply a function over the data variables in this dataset and return a new dataset with the result.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/dataset.py
Dataset.assign
def assign(self, variables=None, **variables_kwargs): """Assign new data variables to a Dataset, returning a new object with all the original variables in addition to the new ones. Parameters ---------- variables : mapping, value pairs Mapping from variables names to...
python
def assign(self, variables=None, **variables_kwargs): """Assign new data variables to a Dataset, returning a new object with all the original variables in addition to the new ones. Parameters ---------- variables : mapping, value pairs Mapping from variables names to...
[ "def", "assign", "(", "self", ",", "variables", "=", "None", ",", "*", "*", "variables_kwargs", ")", ":", "variables", "=", "either_dict_or_kwargs", "(", "variables", ",", "variables_kwargs", ",", "'assign'", ")", "data", "=", "self", ".", "copy", "(", ")"...
Assign new data variables to a Dataset, returning a new object with all the original variables in addition to the new ones. Parameters ---------- variables : mapping, value pairs Mapping from variables names to the new values. If the new values are callable, they...
[ "Assign", "new", "data", "variables", "to", "a", "Dataset", "returning", "a", "new", "object", "with", "all", "the", "original", "variables", "in", "addition", "to", "the", "new", "ones", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L3252-L3292
train
Assign new data variables to a Dataset returning a new Dataset with all the original variables added to the new ones.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/dataset.py
Dataset.to_array
def to_array(self, dim='variable', name=None): """Convert this dataset into an xarray.DataArray The data variables of this dataset will be broadcast against each other and stacked along the first axis of the new array. All coordinates of this dataset will remain coordinates. Pa...
python
def to_array(self, dim='variable', name=None): """Convert this dataset into an xarray.DataArray The data variables of this dataset will be broadcast against each other and stacked along the first axis of the new array. All coordinates of this dataset will remain coordinates. Pa...
[ "def", "to_array", "(", "self", ",", "dim", "=", "'variable'", ",", "name", "=", "None", ")", ":", "from", ".", "dataarray", "import", "DataArray", "data_vars", "=", "[", "self", ".", "variables", "[", "k", "]", "for", "k", "in", "self", ".", "data_v...
Convert this dataset into an xarray.DataArray The data variables of this dataset will be broadcast against each other and stacked along the first axis of the new array. All coordinates of this dataset will remain coordinates. Parameters ---------- dim : str, optional ...
[ "Convert", "this", "dataset", "into", "an", "xarray", ".", "DataArray" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L3294-L3323
train
Convert this dataset into an xarray. DataArray.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/dataset.py
Dataset.to_dask_dataframe
def to_dask_dataframe(self, dim_order=None, set_index=False): """ Convert this dataset into a dask.dataframe.DataFrame. The dimensions, coordinates and data variables in this dataset form the columns of the DataFrame. Parameters ---------- dim_order : list, opti...
python
def to_dask_dataframe(self, dim_order=None, set_index=False): """ Convert this dataset into a dask.dataframe.DataFrame. The dimensions, coordinates and data variables in this dataset form the columns of the DataFrame. Parameters ---------- dim_order : list, opti...
[ "def", "to_dask_dataframe", "(", "self", ",", "dim_order", "=", "None", ",", "set_index", "=", "False", ")", ":", "import", "dask", ".", "array", "as", "da", "import", "dask", ".", "dataframe", "as", "dd", "if", "dim_order", "is", "None", ":", "dim_order...
Convert this dataset into a dask.dataframe.DataFrame. The dimensions, coordinates and data variables in this dataset form the columns of the DataFrame. Parameters ---------- dim_order : list, optional Hierarchical dimension order for the resulting dataframe. All ...
[ "Convert", "this", "dataset", "into", "a", "dask", ".", "dataframe", ".", "DataFrame", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L3384-L3458
train
Convert this dataset into a dask. dataframe. DataFrame.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/dataset.py
Dataset.to_dict
def to_dict(self, data=True): """ Convert this dataset to a dictionary following xarray naming conventions. Converts all variables and attributes to native Python objects Useful for coverting to json. To avoid datetime incompatibility use decode_times=False kwarg in xarr...
python
def to_dict(self, data=True): """ Convert this dataset to a dictionary following xarray naming conventions. Converts all variables and attributes to native Python objects Useful for coverting to json. To avoid datetime incompatibility use decode_times=False kwarg in xarr...
[ "def", "to_dict", "(", "self", ",", "data", "=", "True", ")", ":", "d", "=", "{", "'coords'", ":", "{", "}", ",", "'attrs'", ":", "decode_numpy_dict_values", "(", "self", ".", "attrs", ")", ",", "'dims'", ":", "dict", "(", "self", ".", "dims", ")",...
Convert this dataset to a dictionary following xarray naming conventions. Converts all variables and attributes to native Python objects Useful for coverting to json. To avoid datetime incompatibility use decode_times=False kwarg in xarrray.open_dataset. Parameters ----...
[ "Convert", "this", "dataset", "to", "a", "dictionary", "following", "xarray", "naming", "conventions", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L3460-L3485
train
Convert this dataset to a dictionary following xarray naming conventions.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/dataset.py
Dataset.from_dict
def from_dict(cls, d): """ Convert a dictionary into an xarray.Dataset. Input dict can take several forms:: d = {'t': {'dims': ('t'), 'data': t}, 'a': {'dims': ('t'), 'data': x}, 'b': {'dims': ('t'), 'data': y}} d = {'coords': {'t': {'...
python
def from_dict(cls, d): """ Convert a dictionary into an xarray.Dataset. Input dict can take several forms:: d = {'t': {'dims': ('t'), 'data': t}, 'a': {'dims': ('t'), 'data': x}, 'b': {'dims': ('t'), 'data': y}} d = {'coords': {'t': {'...
[ "def", "from_dict", "(", "cls", ",", "d", ")", ":", "if", "not", "set", "(", "[", "'coords'", ",", "'data_vars'", "]", ")", ".", "issubset", "(", "set", "(", "d", ")", ")", ":", "variables", "=", "d", ".", "items", "(", ")", "else", ":", "impor...
Convert a dictionary into an xarray.Dataset. Input dict can take several forms:: d = {'t': {'dims': ('t'), 'data': t}, 'a': {'dims': ('t'), 'data': x}, 'b': {'dims': ('t'), 'data': y}} d = {'coords': {'t': {'dims': 't', 'data': t, ...
[ "Convert", "a", "dictionary", "into", "an", "xarray", ".", "Dataset", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L3488-L3547
train
Convert a dictionary into an xarray. Dataset.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/dataset.py
Dataset.diff
def diff(self, dim, n=1, label='upper'): """Calculate the n-th order discrete difference along given axis. Parameters ---------- dim : str, optional Dimension over which to calculate the finite difference. n : int, optional The number of times values are ...
python
def diff(self, dim, n=1, label='upper'): """Calculate the n-th order discrete difference along given axis. Parameters ---------- dim : str, optional Dimension over which to calculate the finite difference. n : int, optional The number of times values are ...
[ "def", "diff", "(", "self", ",", "dim", ",", "n", "=", "1", ",", "label", "=", "'upper'", ")", ":", "if", "n", "==", "0", ":", "return", "self", "if", "n", "<", "0", ":", "raise", "ValueError", "(", "'order `n` must be non-negative but got {0}'", "''",...
Calculate the n-th order discrete difference along given axis. Parameters ---------- dim : str, optional Dimension over which to calculate the finite difference. n : int, optional The number of times values are differenced. label : str, optional ...
[ "Calculate", "the", "n", "-", "th", "order", "discrete", "difference", "along", "given", "axis", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L3647-L3725
train
Calculate the n - th order discrete difference along a given dimension.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/dataset.py
Dataset.shift
def shift(self, shifts=None, fill_value=dtypes.NA, **shifts_kwargs): """Shift this dataset by an offset along one or more dimensions. Only data variables are moved; coordinates stay in place. This is consistent with the behavior of ``shift`` in pandas. Parameters ---------- ...
python
def shift(self, shifts=None, fill_value=dtypes.NA, **shifts_kwargs): """Shift this dataset by an offset along one or more dimensions. Only data variables are moved; coordinates stay in place. This is consistent with the behavior of ``shift`` in pandas. Parameters ---------- ...
[ "def", "shift", "(", "self", ",", "shifts", "=", "None", ",", "fill_value", "=", "dtypes", ".", "NA", ",", "*", "*", "shifts_kwargs", ")", ":", "shifts", "=", "either_dict_or_kwargs", "(", "shifts", ",", "shifts_kwargs", ",", "'shift'", ")", "invalid", "...
Shift this dataset by an offset along one or more dimensions. Only data variables are moved; coordinates stay in place. This is consistent with the behavior of ``shift`` in pandas. Parameters ---------- shifts : Mapping with the form of {dim: offset} Integer offset ...
[ "Shift", "this", "dataset", "by", "an", "offset", "along", "one", "or", "more", "dimensions", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L3727-L3782
train
Shifts this Dataset by an offset along one or more dimensions.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/dataset.py
Dataset.roll
def roll(self, shifts=None, roll_coords=None, **shifts_kwargs): """Roll this dataset by an offset along one or more dimensions. Unlike shift, roll may rotate all variables, including coordinates if specified. The direction of rotation is consistent with :py:func:`numpy.roll`. P...
python
def roll(self, shifts=None, roll_coords=None, **shifts_kwargs): """Roll this dataset by an offset along one or more dimensions. Unlike shift, roll may rotate all variables, including coordinates if specified. The direction of rotation is consistent with :py:func:`numpy.roll`. P...
[ "def", "roll", "(", "self", ",", "shifts", "=", "None", ",", "roll_coords", "=", "None", ",", "*", "*", "shifts_kwargs", ")", ":", "shifts", "=", "either_dict_or_kwargs", "(", "shifts", ",", "shifts_kwargs", ",", "'roll'", ")", "invalid", "=", "[", "k", ...
Roll this dataset by an offset along one or more dimensions. Unlike shift, roll may rotate all variables, including coordinates if specified. The direction of rotation is consistent with :py:func:`numpy.roll`. Parameters ---------- shifts : dict, optional A...
[ "Roll", "this", "dataset", "by", "an", "offset", "along", "one", "or", "more", "dimensions", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L3784-L3849
train
Roll this Dataset by an offset along one or more dimensions.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/dataset.py
Dataset.sortby
def sortby(self, variables, ascending=True): """ Sort object by labels or values (along an axis). Sorts the dataset, either along specified dimensions, or according to values of 1-D dataarrays that share dimension with calling object. If the input variables are dataarra...
python
def sortby(self, variables, ascending=True): """ Sort object by labels or values (along an axis). Sorts the dataset, either along specified dimensions, or according to values of 1-D dataarrays that share dimension with calling object. If the input variables are dataarra...
[ "def", "sortby", "(", "self", ",", "variables", ",", "ascending", "=", "True", ")", ":", "from", ".", "dataarray", "import", "DataArray", "if", "not", "isinstance", "(", "variables", ",", "list", ")", ":", "variables", "=", "[", "variables", "]", "else",...
Sort object by labels or values (along an axis). Sorts the dataset, either along specified dimensions, or according to values of 1-D dataarrays that share dimension with calling object. If the input variables are dataarrays, then the dataarrays are aligned (via left-join) to th...
[ "Sort", "object", "by", "labels", "or", "values", "(", "along", "an", "axis", ")", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L3851-L3910
train
Sort the dataset by the specified variables.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/dataset.py
Dataset.quantile
def quantile(self, q, dim=None, interpolation='linear', numeric_only=False, keep_attrs=None): """Compute the qth quantile of the data along the specified dimension. Returns the qth quantiles(s) of the array elements for each variable in the Dataset. Parameters ...
python
def quantile(self, q, dim=None, interpolation='linear', numeric_only=False, keep_attrs=None): """Compute the qth quantile of the data along the specified dimension. Returns the qth quantiles(s) of the array elements for each variable in the Dataset. Parameters ...
[ "def", "quantile", "(", "self", ",", "q", ",", "dim", "=", "None", ",", "interpolation", "=", "'linear'", ",", "numeric_only", "=", "False", ",", "keep_attrs", "=", "None", ")", ":", "if", "isinstance", "(", "dim", ",", "str", ")", ":", "dims", "=", ...
Compute the qth quantile of the data along the specified dimension. Returns the qth quantiles(s) of the array elements for each variable in the Dataset. Parameters ---------- q : float in range of [0,1] (or sequence of floats) Quantile to compute, which must be betw...
[ "Compute", "the", "qth", "quantile", "of", "the", "data", "along", "the", "specified", "dimension", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L3912-L3999
train
Compute the qth quantile of the data along the specified dimension.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/dataset.py
Dataset.rank
def rank(self, dim, pct=False, keep_attrs=None): """Ranks the data. Equal values are assigned a rank that is the average of the ranks that would have been otherwise assigned to all of the values within that set. Ranks begin at 1, not 0. If pct is True, computes percentage ranks....
python
def rank(self, dim, pct=False, keep_attrs=None): """Ranks the data. Equal values are assigned a rank that is the average of the ranks that would have been otherwise assigned to all of the values within that set. Ranks begin at 1, not 0. If pct is True, computes percentage ranks....
[ "def", "rank", "(", "self", ",", "dim", ",", "pct", "=", "False", ",", "keep_attrs", "=", "None", ")", ":", "if", "dim", "not", "in", "self", ".", "dims", ":", "raise", "ValueError", "(", "'Dataset does not contain the dimension: %s'", "%", "dim", ")", "...
Ranks the data. Equal values are assigned a rank that is the average of the ranks that would have been otherwise assigned to all of the values within that set. Ranks begin at 1, not 0. If pct is True, computes percentage ranks. NaNs in the input array are returned as NaNs. ...
[ "Ranks", "the", "data", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L4001-L4045
train
Ranks the data.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/dataset.py
Dataset.differentiate
def differentiate(self, coord, edge_order=1, datetime_unit=None): """ Differentiate with the second order accurate central differences. .. note:: This feature is limited to simple cartesian geometry, i.e. coord must be one dimensional. Parameters -------...
python
def differentiate(self, coord, edge_order=1, datetime_unit=None): """ Differentiate with the second order accurate central differences. .. note:: This feature is limited to simple cartesian geometry, i.e. coord must be one dimensional. Parameters -------...
[ "def", "differentiate", "(", "self", ",", "coord", ",", "edge_order", "=", "1", ",", "datetime_unit", "=", "None", ")", ":", "from", ".", "variable", "import", "Variable", "if", "coord", "not", "in", "self", ".", "variables", "and", "coord", "not", "in",...
Differentiate with the second order accurate central differences. .. note:: This feature is limited to simple cartesian geometry, i.e. coord must be one dimensional. Parameters ---------- coord: str The coordinate to be used to compute the gr...
[ "Differentiate", "with", "the", "second", "order", "accurate", "central", "differences", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L4047-L4103
train
Differentiate with the second order accurate central centralCOOKIE entries.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/dataset.py
Dataset.integrate
def integrate(self, coord, datetime_unit=None): """ integrate the array with the trapezoidal rule. .. note:: This feature is limited to simple cartesian geometry, i.e. coord must be one dimensional. Parameters ---------- dim: str, or a sequence of str ...
python
def integrate(self, coord, datetime_unit=None): """ integrate the array with the trapezoidal rule. .. note:: This feature is limited to simple cartesian geometry, i.e. coord must be one dimensional. Parameters ---------- dim: str, or a sequence of str ...
[ "def", "integrate", "(", "self", ",", "coord", ",", "datetime_unit", "=", "None", ")", ":", "if", "not", "isinstance", "(", "coord", ",", "(", "list", ",", "tuple", ")", ")", ":", "coord", "=", "(", "coord", ",", ")", "result", "=", "self", "for", ...
integrate the array with the trapezoidal rule. .. note:: This feature is limited to simple cartesian geometry, i.e. coord must be one dimensional. Parameters ---------- dim: str, or a sequence of str Coordinate(s) used for the integration. da...
[ "integrate", "the", "array", "with", "the", "trapezoidal", "rule", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L4105-L4135
train
Integrate the array with the trapezoidal rule.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/dataset.py
Dataset.filter_by_attrs
def filter_by_attrs(self, **kwargs): """Returns a ``Dataset`` with variables that match specific conditions. Can pass in ``key=value`` or ``key=callable``. A Dataset is returned containing only the variables for which all the filter tests pass. These tests are either ``key=value`` for ...
python
def filter_by_attrs(self, **kwargs): """Returns a ``Dataset`` with variables that match specific conditions. Can pass in ``key=value`` or ``key=callable``. A Dataset is returned containing only the variables for which all the filter tests pass. These tests are either ``key=value`` for ...
[ "def", "filter_by_attrs", "(", "self", ",", "*", "*", "kwargs", ")", ":", "# noqa", "selection", "=", "[", "]", "for", "var_name", ",", "variable", "in", "self", ".", "data_vars", ".", "items", "(", ")", ":", "has_value_flag", "=", "False", "for", "att...
Returns a ``Dataset`` with variables that match specific conditions. Can pass in ``key=value`` or ``key=callable``. A Dataset is returned containing only the variables for which all the filter tests pass. These tests are either ``key=value`` for which the attribute ``key`` has the exac...
[ "Returns", "a", "Dataset", "with", "variables", "that", "match", "specific", "conditions", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L4187-L4278
train
Returns a new Dataset with variables that match specific conditions.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/coding/variables.py
lazy_elemwise_func
def lazy_elemwise_func(array, func, dtype): """Lazily apply an element-wise function to an array. Parameters ---------- array : any valid value of Variable._data func : callable Function to apply to indexed slices of an array. For use with dask, this should be a pickle-able object. ...
python
def lazy_elemwise_func(array, func, dtype): """Lazily apply an element-wise function to an array. Parameters ---------- array : any valid value of Variable._data func : callable Function to apply to indexed slices of an array. For use with dask, this should be a pickle-able object. ...
[ "def", "lazy_elemwise_func", "(", "array", ",", "func", ",", "dtype", ")", ":", "if", "isinstance", "(", "array", ",", "dask_array_type", ")", ":", "return", "array", ".", "map_blocks", "(", "func", ",", "dtype", "=", "dtype", ")", "else", ":", "return",...
Lazily apply an element-wise function to an array. Parameters ---------- array : any valid value of Variable._data func : callable Function to apply to indexed slices of an array. For use with dask, this should be a pickle-able object. dtype : coercible to np.dtype Dtype for...
[ "Lazily", "apply", "an", "element", "-", "wise", "function", "to", "an", "array", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/coding/variables.py#L75-L94
train
Lazily apply an element - wise function to an array.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/coding/variables.py
pop_to
def pop_to(source, dest, key, name=None): """ A convenience function which pops a key k from source to dest. None values are not passed on. If k already exists in dest an error is raised. """ value = source.pop(key, None) if value is not None: safe_setitem(dest, key, value, name=nam...
python
def pop_to(source, dest, key, name=None): """ A convenience function which pops a key k from source to dest. None values are not passed on. If k already exists in dest an error is raised. """ value = source.pop(key, None) if value is not None: safe_setitem(dest, key, value, name=nam...
[ "def", "pop_to", "(", "source", ",", "dest", ",", "key", ",", "name", "=", "None", ")", ":", "value", "=", "source", ".", "pop", "(", "key", ",", "None", ")", "if", "value", "is", "not", "None", ":", "safe_setitem", "(", "dest", ",", "key", ",", ...
A convenience function which pops a key k from source to dest. None values are not passed on. If k already exists in dest an error is raised.
[ "A", "convenience", "function", "which", "pops", "a", "key", "k", "from", "source", "to", "dest", ".", "None", "values", "are", "not", "passed", "on", ".", "If", "k", "already", "exists", "in", "dest", "an", "error", "is", "raised", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/coding/variables.py#L116-L125
train
A convenience function which pops a key from source to dest.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/coding/variables.py
_apply_mask
def _apply_mask( data: np.ndarray, encoded_fill_values: list, decoded_fill_value: Any, dtype: Any, ) -> np.ndarray: """Mask all matching values in a NumPy arrays.""" data = np.asarray(data, dtype=dtype) condition = False for fv in encoded_fill_values: condition |= data == fv ...
python
def _apply_mask( data: np.ndarray, encoded_fill_values: list, decoded_fill_value: Any, dtype: Any, ) -> np.ndarray: """Mask all matching values in a NumPy arrays.""" data = np.asarray(data, dtype=dtype) condition = False for fv in encoded_fill_values: condition |= data == fv ...
[ "def", "_apply_mask", "(", "data", ":", "np", ".", "ndarray", ",", "encoded_fill_values", ":", "list", ",", "decoded_fill_value", ":", "Any", ",", "dtype", ":", "Any", ",", ")", "->", "np", ".", "ndarray", ":", "data", "=", "np", ".", "asarray", "(", ...
Mask all matching values in a NumPy arrays.
[ "Mask", "all", "matching", "values", "in", "a", "NumPy", "arrays", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/coding/variables.py#L128-L139
train
Mask all matching values in a NumPy arrays.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/coding/variables.py
_choose_float_dtype
def _choose_float_dtype(dtype, has_offset): """Return a float dtype that can losslessly represent `dtype` values.""" # Keep float32 as-is. Upcast half-precision to single-precision, # because float16 is "intended for storage but not computation" if dtype.itemsize <= 4 and np.issubdtype(dtype, np.floati...
python
def _choose_float_dtype(dtype, has_offset): """Return a float dtype that can losslessly represent `dtype` values.""" # Keep float32 as-is. Upcast half-precision to single-precision, # because float16 is "intended for storage but not computation" if dtype.itemsize <= 4 and np.issubdtype(dtype, np.floati...
[ "def", "_choose_float_dtype", "(", "dtype", ",", "has_offset", ")", ":", "# Keep float32 as-is. Upcast half-precision to single-precision,", "# because float16 is \"intended for storage but not computation\"", "if", "dtype", ".", "itemsize", "<=", "4", "and", "np", ".", "issub...
Return a float dtype that can losslessly represent `dtype` values.
[ "Return", "a", "float", "dtype", "that", "can", "losslessly", "represent", "dtype", "values", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/coding/variables.py#L192-L208
train
Return a float dtype that can losslessly represent dtype values.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/missing.py
_apply_over_vars_with_dim
def _apply_over_vars_with_dim(func, self, dim=None, **kwargs): '''wrapper for datasets''' ds = type(self)(coords=self.coords, attrs=self.attrs) for name, var in self.data_vars.items(): if dim in var.dims: ds[name] = func(var, dim=dim, **kwargs) else: ds[name] = var ...
python
def _apply_over_vars_with_dim(func, self, dim=None, **kwargs): '''wrapper for datasets''' ds = type(self)(coords=self.coords, attrs=self.attrs) for name, var in self.data_vars.items(): if dim in var.dims: ds[name] = func(var, dim=dim, **kwargs) else: ds[name] = var ...
[ "def", "_apply_over_vars_with_dim", "(", "func", ",", "self", ",", "dim", "=", "None", ",", "*", "*", "kwargs", ")", ":", "ds", "=", "type", "(", "self", ")", "(", "coords", "=", "self", ".", "coords", ",", "attrs", "=", "self", ".", "attrs", ")", ...
wrapper for datasets
[ "wrapper", "for", "datasets" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/missing.py#L142-L153
train
wrapper for datasets with dim = None
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/missing.py
get_clean_interp_index
def get_clean_interp_index(arr, dim, use_coordinate=True, **kwargs): '''get index to use for x values in interpolation. If use_coordinate is True, the coordinate that shares the name of the dimension along which interpolation is being performed will be used as the x values. If use_coordinate is Fa...
python
def get_clean_interp_index(arr, dim, use_coordinate=True, **kwargs): '''get index to use for x values in interpolation. If use_coordinate is True, the coordinate that shares the name of the dimension along which interpolation is being performed will be used as the x values. If use_coordinate is Fa...
[ "def", "get_clean_interp_index", "(", "arr", ",", "dim", ",", "use_coordinate", "=", "True", ",", "*", "*", "kwargs", ")", ":", "if", "use_coordinate", ":", "if", "use_coordinate", "is", "True", ":", "index", "=", "arr", ".", "get_index", "(", "dim", ")"...
get index to use for x values in interpolation. If use_coordinate is True, the coordinate that shares the name of the dimension along which interpolation is being performed will be used as the x values. If use_coordinate is False, the x values are set as an equally spaced sequence.
[ "get", "index", "to", "use", "for", "x", "values", "in", "interpolation", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/missing.py#L156-L191
train
get index to use for x values in interpolation.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/missing.py
interp_na
def interp_na(self, dim=None, use_coordinate=True, method='linear', limit=None, **kwargs): '''Interpolate values according to different methods.''' if dim is None: raise NotImplementedError('dim is a required argument') if limit is not None: valids = _get_valid_fill_mask(self...
python
def interp_na(self, dim=None, use_coordinate=True, method='linear', limit=None, **kwargs): '''Interpolate values according to different methods.''' if dim is None: raise NotImplementedError('dim is a required argument') if limit is not None: valids = _get_valid_fill_mask(self...
[ "def", "interp_na", "(", "self", ",", "dim", "=", "None", ",", "use_coordinate", "=", "True", ",", "method", "=", "'linear'", ",", "limit", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "dim", "is", "None", ":", "raise", "NotImplementedError", ...
Interpolate values according to different methods.
[ "Interpolate", "values", "according", "to", "different", "methods", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/missing.py#L194-L224
train
Interpolate values according to different methods.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/missing.py
func_interpolate_na
def func_interpolate_na(interpolator, x, y, **kwargs): '''helper function to apply interpolation along 1 dimension''' # it would be nice if this wasn't necessary, works around: # "ValueError: assignment destination is read-only" in assignment below out = y.copy() nans = pd.isnull(y) nonans = ~n...
python
def func_interpolate_na(interpolator, x, y, **kwargs): '''helper function to apply interpolation along 1 dimension''' # it would be nice if this wasn't necessary, works around: # "ValueError: assignment destination is read-only" in assignment below out = y.copy() nans = pd.isnull(y) nonans = ~n...
[ "def", "func_interpolate_na", "(", "interpolator", ",", "x", ",", "y", ",", "*", "*", "kwargs", ")", ":", "# it would be nice if this wasn't necessary, works around:", "# \"ValueError: assignment destination is read-only\" in assignment below", "out", "=", "y", ".", "copy", ...
helper function to apply interpolation along 1 dimension
[ "helper", "function", "to", "apply", "interpolation", "along", "1", "dimension" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/missing.py#L227-L243
train
helper function to apply interpolation along 1 dimension
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/missing.py
_bfill
def _bfill(arr, n=None, axis=-1): '''inverse of ffill''' import bottleneck as bn arr = np.flip(arr, axis=axis) # fill arr = bn.push(arr, axis=axis, n=n) # reverse back to original return np.flip(arr, axis=axis)
python
def _bfill(arr, n=None, axis=-1): '''inverse of ffill''' import bottleneck as bn arr = np.flip(arr, axis=axis) # fill arr = bn.push(arr, axis=axis, n=n) # reverse back to original return np.flip(arr, axis=axis)
[ "def", "_bfill", "(", "arr", ",", "n", "=", "None", ",", "axis", "=", "-", "1", ")", ":", "import", "bottleneck", "as", "bn", "arr", "=", "np", ".", "flip", "(", "arr", ",", "axis", "=", "axis", ")", "# fill", "arr", "=", "bn", ".", "push", "...
inverse of ffill
[ "inverse", "of", "ffill" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/missing.py#L246-L256
train
inverse of ffill
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/missing.py
ffill
def ffill(arr, dim=None, limit=None): '''forward fill missing values''' import bottleneck as bn axis = arr.get_axis_num(dim) # work around for bottleneck 178 _limit = limit if limit is not None else arr.shape[axis] return apply_ufunc(bn.push, arr, dask='parallelized', ...
python
def ffill(arr, dim=None, limit=None): '''forward fill missing values''' import bottleneck as bn axis = arr.get_axis_num(dim) # work around for bottleneck 178 _limit = limit if limit is not None else arr.shape[axis] return apply_ufunc(bn.push, arr, dask='parallelized', ...
[ "def", "ffill", "(", "arr", ",", "dim", "=", "None", ",", "limit", "=", "None", ")", ":", "import", "bottleneck", "as", "bn", "axis", "=", "arr", ".", "get_axis_num", "(", "dim", ")", "# work around for bottleneck 178", "_limit", "=", "limit", "if", "lim...
forward fill missing values
[ "forward", "fill", "missing", "values" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/missing.py#L259-L272
train
forward fill missing values
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/missing.py
bfill
def bfill(arr, dim=None, limit=None): '''backfill missing values''' axis = arr.get_axis_num(dim) # work around for bottleneck 178 _limit = limit if limit is not None else arr.shape[axis] return apply_ufunc(_bfill, arr, dask='parallelized', keep_attrs=T...
python
def bfill(arr, dim=None, limit=None): '''backfill missing values''' axis = arr.get_axis_num(dim) # work around for bottleneck 178 _limit = limit if limit is not None else arr.shape[axis] return apply_ufunc(_bfill, arr, dask='parallelized', keep_attrs=T...
[ "def", "bfill", "(", "arr", ",", "dim", "=", "None", ",", "limit", "=", "None", ")", ":", "axis", "=", "arr", ".", "get_axis_num", "(", "dim", ")", "# work around for bottleneck 178", "_limit", "=", "limit", "if", "limit", "is", "not", "None", "else", ...
backfill missing values
[ "backfill", "missing", "values" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/missing.py#L275-L286
train
backfill missing values
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/missing.py
_get_interpolator
def _get_interpolator(method, vectorizeable_only=False, **kwargs): '''helper function to select the appropriate interpolator class returns interpolator class and keyword arguments for the class ''' interp1d_methods = ['linear', 'nearest', 'zero', 'slinear', 'quadratic', 'cubic',...
python
def _get_interpolator(method, vectorizeable_only=False, **kwargs): '''helper function to select the appropriate interpolator class returns interpolator class and keyword arguments for the class ''' interp1d_methods = ['linear', 'nearest', 'zero', 'slinear', 'quadratic', 'cubic',...
[ "def", "_get_interpolator", "(", "method", ",", "vectorizeable_only", "=", "False", ",", "*", "*", "kwargs", ")", ":", "interp1d_methods", "=", "[", "'linear'", ",", "'nearest'", ",", "'zero'", ",", "'slinear'", ",", "'quadratic'", ",", "'cubic'", ",", "'pol...
helper function to select the appropriate interpolator class returns interpolator class and keyword arguments for the class
[ "helper", "function", "to", "select", "the", "appropriate", "interpolator", "class" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/missing.py#L289-L340
train
helper function to select the appropriate interpolator class for the appropriate class returns interpolator class and keyword arguments for the class
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/missing.py
_get_interpolator_nd
def _get_interpolator_nd(method, **kwargs): '''helper function to select the appropriate interpolator class returns interpolator class and keyword arguments for the class ''' valid_methods = ['linear', 'nearest'] try: from scipy import interpolate except ImportError: raise Impo...
python
def _get_interpolator_nd(method, **kwargs): '''helper function to select the appropriate interpolator class returns interpolator class and keyword arguments for the class ''' valid_methods = ['linear', 'nearest'] try: from scipy import interpolate except ImportError: raise Impo...
[ "def", "_get_interpolator_nd", "(", "method", ",", "*", "*", "kwargs", ")", ":", "valid_methods", "=", "[", "'linear'", ",", "'nearest'", "]", "try", ":", "from", "scipy", "import", "interpolate", "except", "ImportError", ":", "raise", "ImportError", "(", "'...
helper function to select the appropriate interpolator class returns interpolator class and keyword arguments for the class
[ "helper", "function", "to", "select", "the", "appropriate", "interpolator", "class" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/missing.py#L343-L363
train
helper function to select the appropriate interpolator class and keyword arguments for the class
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/missing.py
_get_valid_fill_mask
def _get_valid_fill_mask(arr, dim, limit): '''helper function to determine values that can be filled when limit is not None''' kw = {dim: limit + 1} # we explicitly use construct method to avoid copy. new_dim = utils.get_temp_dimname(arr.dims, '_window') return (arr.isnull().rolling(min_periods=...
python
def _get_valid_fill_mask(arr, dim, limit): '''helper function to determine values that can be filled when limit is not None''' kw = {dim: limit + 1} # we explicitly use construct method to avoid copy. new_dim = utils.get_temp_dimname(arr.dims, '_window') return (arr.isnull().rolling(min_periods=...
[ "def", "_get_valid_fill_mask", "(", "arr", ",", "dim", ",", "limit", ")", ":", "kw", "=", "{", "dim", ":", "limit", "+", "1", "}", "# we explicitly use construct method to avoid copy.", "new_dim", "=", "utils", ".", "get_temp_dimname", "(", "arr", ".", "dims",...
helper function to determine values that can be filled when limit is not None
[ "helper", "function", "to", "determine", "values", "that", "can", "be", "filled", "when", "limit", "is", "not", "None" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/missing.py#L366-L374
train
helper function to determine values that can be filled when limit is not None
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/missing.py
_localize
def _localize(var, indexes_coords): """ Speed up for linear and nearest neighbor method. Only consider a subspace that is needed for the interpolation """ indexes = {} for dim, [x, new_x] in indexes_coords.items(): index = x.to_index() imin = index.get_loc(np.min(new_x.values), metho...
python
def _localize(var, indexes_coords): """ Speed up for linear and nearest neighbor method. Only consider a subspace that is needed for the interpolation """ indexes = {} for dim, [x, new_x] in indexes_coords.items(): index = x.to_index() imin = index.get_loc(np.min(new_x.values), metho...
[ "def", "_localize", "(", "var", ",", "indexes_coords", ")", ":", "indexes", "=", "{", "}", "for", "dim", ",", "[", "x", ",", "new_x", "]", "in", "indexes_coords", ".", "items", "(", ")", ":", "index", "=", "x", ".", "to_index", "(", ")", "imin", ...
Speed up for linear and nearest neighbor method. Only consider a subspace that is needed for the interpolation
[ "Speed", "up", "for", "linear", "and", "nearest", "neighbor", "method", ".", "Only", "consider", "a", "subspace", "that", "is", "needed", "for", "the", "interpolation" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/missing.py#L385-L397
train
Localize a variable by linear and nearest neighbor method.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/missing.py
_floatize_x
def _floatize_x(x, new_x): """ Make x and new_x float. This is particulary useful for datetime dtype. x, new_x: tuple of np.ndarray """ x = list(x) new_x = list(new_x) for i in range(len(x)): if _contains_datetime_like_objects(x[i]): # Scipy casts coordinates to np.float6...
python
def _floatize_x(x, new_x): """ Make x and new_x float. This is particulary useful for datetime dtype. x, new_x: tuple of np.ndarray """ x = list(x) new_x = list(new_x) for i in range(len(x)): if _contains_datetime_like_objects(x[i]): # Scipy casts coordinates to np.float6...
[ "def", "_floatize_x", "(", "x", ",", "new_x", ")", ":", "x", "=", "list", "(", "x", ")", "new_x", "=", "list", "(", "new_x", ")", "for", "i", "in", "range", "(", "len", "(", "x", ")", ")", ":", "if", "_contains_datetime_like_objects", "(", "x", "...
Make x and new_x float. This is particulary useful for datetime dtype. x, new_x: tuple of np.ndarray
[ "Make", "x", "and", "new_x", "float", ".", "This", "is", "particulary", "useful", "for", "datetime", "dtype", ".", "x", "new_x", ":", "tuple", "of", "np", ".", "ndarray" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/missing.py#L400-L417
train
Make x and new_x float.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/missing.py
interp
def interp(var, indexes_coords, method, **kwargs): """ Make an interpolation of Variable Parameters ---------- var: Variable index_coords: Mapping from dimension name to a pair of original and new coordinates. Original coordinates should be sorted in strictly ascending order. ...
python
def interp(var, indexes_coords, method, **kwargs): """ Make an interpolation of Variable Parameters ---------- var: Variable index_coords: Mapping from dimension name to a pair of original and new coordinates. Original coordinates should be sorted in strictly ascending order. ...
[ "def", "interp", "(", "var", ",", "indexes_coords", ",", "method", ",", "*", "*", "kwargs", ")", ":", "if", "not", "indexes_coords", ":", "return", "var", ".", "copy", "(", ")", "# simple speed up for the local interpolation", "if", "method", "in", "[", "'li...
Make an interpolation of Variable Parameters ---------- var: Variable index_coords: Mapping from dimension name to a pair of original and new coordinates. Original coordinates should be sorted in strictly ascending order. Note that all the coordinates should be Variable objects....
[ "Make", "an", "interpolation", "of", "Variable" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/missing.py#L420-L477
train
Interpolate a Variable with a set of indexes coordinates.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/missing.py
interp_func
def interp_func(var, x, new_x, method, kwargs): """ multi-dimensional interpolation for array-like. Interpolated axes should be located in the last position. Parameters ---------- var: np.ndarray or dask.array.Array Array to be interpolated. The final dimension is interpolated. x: a...
python
def interp_func(var, x, new_x, method, kwargs): """ multi-dimensional interpolation for array-like. Interpolated axes should be located in the last position. Parameters ---------- var: np.ndarray or dask.array.Array Array to be interpolated. The final dimension is interpolated. x: a...
[ "def", "interp_func", "(", "var", ",", "x", ",", "new_x", ",", "method", ",", "kwargs", ")", ":", "if", "not", "x", ":", "return", "var", ".", "copy", "(", ")", "if", "len", "(", "x", ")", "==", "1", ":", "func", ",", "kwargs", "=", "_get_inter...
multi-dimensional interpolation for array-like. Interpolated axes should be located in the last position. Parameters ---------- var: np.ndarray or dask.array.Array Array to be interpolated. The final dimension is interpolated. x: a list of 1d array. Original coordinates. Should not ...
[ "multi", "-", "dimensional", "interpolation", "for", "array", "-", "like", ".", "Interpolated", "axes", "should", "be", "located", "in", "the", "last", "position", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/missing.py#L480-L533
train
Interpolate a 1 - dimensional array - like or array - like into a new array - like.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/plot/facetgrid.py
_nicetitle
def _nicetitle(coord, value, maxchar, template): """ Put coord, value in template and truncate at maxchar """ prettyvalue = format_item(value, quote_strings=False) title = template.format(coord=coord, value=prettyvalue) if len(title) > maxchar: title = title[:(maxchar - 3)] + '...' ...
python
def _nicetitle(coord, value, maxchar, template): """ Put coord, value in template and truncate at maxchar """ prettyvalue = format_item(value, quote_strings=False) title = template.format(coord=coord, value=prettyvalue) if len(title) > maxchar: title = title[:(maxchar - 3)] + '...' ...
[ "def", "_nicetitle", "(", "coord", ",", "value", ",", "maxchar", ",", "template", ")", ":", "prettyvalue", "=", "format_item", "(", "value", ",", "quote_strings", "=", "False", ")", "title", "=", "template", ".", "format", "(", "coord", "=", "coord", ","...
Put coord, value in template and truncate at maxchar
[ "Put", "coord", "value", "in", "template", "and", "truncate", "at", "maxchar" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/facetgrid.py#L20-L30
train
Return a nicetitle for a given coordinate and value.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/plot/facetgrid.py
_easy_facetgrid
def _easy_facetgrid(data, plotfunc, kind, x=None, y=None, row=None, col=None, col_wrap=None, sharex=True, sharey=True, aspect=None, size=None, subplot_kws=None, **kwargs): """ Convenience method to call xarray.plot.FacetGrid from 2d plotting methods kwargs are the ar...
python
def _easy_facetgrid(data, plotfunc, kind, x=None, y=None, row=None, col=None, col_wrap=None, sharex=True, sharey=True, aspect=None, size=None, subplot_kws=None, **kwargs): """ Convenience method to call xarray.plot.FacetGrid from 2d plotting methods kwargs are the ar...
[ "def", "_easy_facetgrid", "(", "data", ",", "plotfunc", ",", "kind", ",", "x", "=", "None", ",", "y", "=", "None", ",", "row", "=", "None", ",", "col", "=", "None", ",", "col_wrap", "=", "None", ",", "sharex", "=", "True", ",", "sharey", "=", "Tr...
Convenience method to call xarray.plot.FacetGrid from 2d plotting methods kwargs are the arguments to 2d plotting method
[ "Convenience", "method", "to", "call", "xarray", ".", "plot", ".", "FacetGrid", "from", "2d", "plotting", "methods" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/facetgrid.py#L494-L521
train
This method is used to make faceted plots from 2d plotting.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/plot/facetgrid.py
FacetGrid.map_dataarray
def map_dataarray(self, func, x, y, **kwargs): """ Apply a plotting function to a 2d facet's subset of the data. This is more convenient and less general than ``FacetGrid.map`` Parameters ---------- func : callable A plotting function with the same signature...
python
def map_dataarray(self, func, x, y, **kwargs): """ Apply a plotting function to a 2d facet's subset of the data. This is more convenient and less general than ``FacetGrid.map`` Parameters ---------- func : callable A plotting function with the same signature...
[ "def", "map_dataarray", "(", "self", ",", "func", ",", "x", ",", "y", ",", "*", "*", "kwargs", ")", ":", "if", "kwargs", ".", "get", "(", "'cbar_ax'", ",", "None", ")", "is", "not", "None", ":", "raise", "ValueError", "(", "'cbar_ax not supported by Fa...
Apply a plotting function to a 2d facet's subset of the data. This is more convenient and less general than ``FacetGrid.map`` Parameters ---------- func : callable A plotting function with the same signature as a 2d xarray plotting method such as `xarray.plot.im...
[ "Apply", "a", "plotting", "function", "to", "a", "2d", "facet", "s", "subset", "of", "the", "data", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/facetgrid.py#L200-L253
train
Applies a function to a 2d xarray containing a subset of the data.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/plot/facetgrid.py
FacetGrid._finalize_grid
def _finalize_grid(self, *axlabels): """Finalize the annotations and layout.""" if not self._finalized: self.set_axis_labels(*axlabels) self.set_titles() self.fig.tight_layout() for ax, namedict in zip(self.axes.flat, self.name_dicts.flat): ...
python
def _finalize_grid(self, *axlabels): """Finalize the annotations and layout.""" if not self._finalized: self.set_axis_labels(*axlabels) self.set_titles() self.fig.tight_layout() for ax, namedict in zip(self.axes.flat, self.name_dicts.flat): ...
[ "def", "_finalize_grid", "(", "self", ",", "*", "axlabels", ")", ":", "if", "not", "self", ".", "_finalized", ":", "self", ".", "set_axis_labels", "(", "*", "axlabels", ")", "self", ".", "set_titles", "(", ")", "self", ".", "fig", ".", "tight_layout", ...
Finalize the annotations and layout.
[ "Finalize", "the", "annotations", "and", "layout", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/facetgrid.py#L283-L294
train
Finalize the annotations and layout.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/plot/facetgrid.py
FacetGrid.add_colorbar
def add_colorbar(self, **kwargs): """Draw a colorbar """ kwargs = kwargs.copy() if self._cmap_extend is not None: kwargs.setdefault('extend', self._cmap_extend) if 'label' not in kwargs: kwargs.setdefault('label', label_from_attrs(self.data)) self....
python
def add_colorbar(self, **kwargs): """Draw a colorbar """ kwargs = kwargs.copy() if self._cmap_extend is not None: kwargs.setdefault('extend', self._cmap_extend) if 'label' not in kwargs: kwargs.setdefault('label', label_from_attrs(self.data)) self....
[ "def", "add_colorbar", "(", "self", ",", "*", "*", "kwargs", ")", ":", "kwargs", "=", "kwargs", ".", "copy", "(", ")", "if", "self", ".", "_cmap_extend", "is", "not", "None", ":", "kwargs", ".", "setdefault", "(", "'extend'", ",", "self", ".", "_cmap...
Draw a colorbar
[ "Draw", "a", "colorbar" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/facetgrid.py#L324-L335
train
Draw a colorbar for the current object
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/plot/facetgrid.py
FacetGrid.set_axis_labels
def set_axis_labels(self, x_var=None, y_var=None): """Set axis labels on the left column and bottom row of the grid.""" if x_var is not None: if x_var in self.data.coords: self._x_var = x_var self.set_xlabels(label_from_attrs(self.data[x_var])) els...
python
def set_axis_labels(self, x_var=None, y_var=None): """Set axis labels on the left column and bottom row of the grid.""" if x_var is not None: if x_var in self.data.coords: self._x_var = x_var self.set_xlabels(label_from_attrs(self.data[x_var])) els...
[ "def", "set_axis_labels", "(", "self", ",", "x_var", "=", "None", ",", "y_var", "=", "None", ")", ":", "if", "x_var", "is", "not", "None", ":", "if", "x_var", "in", "self", ".", "data", ".", "coords", ":", "self", ".", "_x_var", "=", "x_var", "self...
Set axis labels on the left column and bottom row of the grid.
[ "Set", "axis", "labels", "on", "the", "left", "column", "and", "bottom", "row", "of", "the", "grid", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/facetgrid.py#L337-L353
train
Set axis labels on the left column and bottom row of the grid.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/plot/facetgrid.py
FacetGrid.set_xlabels
def set_xlabels(self, label=None, **kwargs): """Label the x axis on the bottom row of the grid.""" if label is None: label = label_from_attrs(self.data[self._x_var]) for ax in self._bottom_axes: ax.set_xlabel(label, **kwargs) return self
python
def set_xlabels(self, label=None, **kwargs): """Label the x axis on the bottom row of the grid.""" if label is None: label = label_from_attrs(self.data[self._x_var]) for ax in self._bottom_axes: ax.set_xlabel(label, **kwargs) return self
[ "def", "set_xlabels", "(", "self", ",", "label", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "label", "is", "None", ":", "label", "=", "label_from_attrs", "(", "self", ".", "data", "[", "self", ".", "_x_var", "]", ")", "for", "ax", "in", ...
Label the x axis on the bottom row of the grid.
[ "Label", "the", "x", "axis", "on", "the", "bottom", "row", "of", "the", "grid", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/facetgrid.py#L355-L361
train
Label the x axis on the bottom row of the grid.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/plot/facetgrid.py
FacetGrid.set_ylabels
def set_ylabels(self, label=None, **kwargs): """Label the y axis on the left column of the grid.""" if label is None: label = label_from_attrs(self.data[self._y_var]) for ax in self._left_axes: ax.set_ylabel(label, **kwargs) return self
python
def set_ylabels(self, label=None, **kwargs): """Label the y axis on the left column of the grid.""" if label is None: label = label_from_attrs(self.data[self._y_var]) for ax in self._left_axes: ax.set_ylabel(label, **kwargs) return self
[ "def", "set_ylabels", "(", "self", ",", "label", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "label", "is", "None", ":", "label", "=", "label_from_attrs", "(", "self", ".", "data", "[", "self", ".", "_y_var", "]", ")", "for", "ax", "in", ...
Label the y axis on the left column of the grid.
[ "Label", "the", "y", "axis", "on", "the", "left", "column", "of", "the", "grid", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/facetgrid.py#L363-L369
train
Label the y axis on the left column of the grid.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/plot/facetgrid.py
FacetGrid.set_titles
def set_titles(self, template="{coord} = {value}", maxchar=30, **kwargs): """ Draw titles either above each facet or on the grid margins. Parameters ---------- template : string Template for plot titles containing {coord} and {value} maxcha...
python
def set_titles(self, template="{coord} = {value}", maxchar=30, **kwargs): """ Draw titles either above each facet or on the grid margins. Parameters ---------- template : string Template for plot titles containing {coord} and {value} maxcha...
[ "def", "set_titles", "(", "self", ",", "template", "=", "\"{coord} = {value}\"", ",", "maxchar", "=", "30", ",", "*", "*", "kwargs", ")", ":", "import", "matplotlib", "as", "mpl", "kwargs", "[", "\"size\"", "]", "=", "kwargs", ".", "pop", "(", "\"size\""...
Draw titles either above each facet or on the grid margins. Parameters ---------- template : string Template for plot titles containing {coord} and {value} maxchar : int Truncate titles at maxchar kwargs : keyword args additional arguments to ...
[ "Draw", "titles", "either", "above", "each", "facet", "or", "on", "the", "grid", "margins", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/facetgrid.py#L371-L418
train
Draw titles on the grid and the grid margins.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/plot/facetgrid.py
FacetGrid.set_ticks
def set_ticks(self, max_xticks=_NTICKS, max_yticks=_NTICKS, fontsize=_FONTSIZE): """ Set and control tick behavior Parameters ---------- max_xticks, max_yticks : int, optional Maximum number of labeled ticks to plot on x, y axes fontsize : s...
python
def set_ticks(self, max_xticks=_NTICKS, max_yticks=_NTICKS, fontsize=_FONTSIZE): """ Set and control tick behavior Parameters ---------- max_xticks, max_yticks : int, optional Maximum number of labeled ticks to plot on x, y axes fontsize : s...
[ "def", "set_ticks", "(", "self", ",", "max_xticks", "=", "_NTICKS", ",", "max_yticks", "=", "_NTICKS", ",", "fontsize", "=", "_FONTSIZE", ")", ":", "from", "matplotlib", ".", "ticker", "import", "MaxNLocator", "# Both are necessary", "x_major_locator", "=", "Max...
Set and control tick behavior Parameters ---------- max_xticks, max_yticks : int, optional Maximum number of labeled ticks to plot on x, y axes fontsize : string or int Font size as used by matplotlib text Returns ------- self : FacetGrid...
[ "Set", "and", "control", "tick", "behavior" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/facetgrid.py#L420-L450
train
Set and control tick behavior on x and y axes.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/plot/facetgrid.py
FacetGrid.map
def map(self, func, *args, **kwargs): """ Apply a plotting function to each facet's subset of the data. Parameters ---------- func : callable A plotting function that takes data and keyword arguments. It must plot to the currently active matplotlib Axes a...
python
def map(self, func, *args, **kwargs): """ Apply a plotting function to each facet's subset of the data. Parameters ---------- func : callable A plotting function that takes data and keyword arguments. It must plot to the currently active matplotlib Axes a...
[ "def", "map", "(", "self", ",", "func", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "plt", "=", "import_matplotlib_pyplot", "(", ")", "for", "ax", ",", "namedict", "in", "zip", "(", "self", ".", "axes", ".", "flat", ",", "self", ".", "na...
Apply a plotting function to each facet's subset of the data. Parameters ---------- func : callable A plotting function that takes data and keyword arguments. It must plot to the currently active matplotlib Axes and take a `color` keyword argument. If facetin...
[ "Apply", "a", "plotting", "function", "to", "each", "facet", "s", "subset", "of", "the", "data", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/plot/facetgrid.py#L452-L491
train
Applies a function to each facet s subset of the data.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/resample_cftime.py
_get_time_bins
def _get_time_bins(index, freq, closed, label, base): """Obtain the bins and their respective labels for resampling operations. Parameters ---------- index : CFTimeIndex Index object to be resampled (e.g., CFTimeIndex named 'time'). freq : xarray.coding.cftime_offsets.BaseCFTimeOffset ...
python
def _get_time_bins(index, freq, closed, label, base): """Obtain the bins and their respective labels for resampling operations. Parameters ---------- index : CFTimeIndex Index object to be resampled (e.g., CFTimeIndex named 'time'). freq : xarray.coding.cftime_offsets.BaseCFTimeOffset ...
[ "def", "_get_time_bins", "(", "index", ",", "freq", ",", "closed", ",", "label", ",", "base", ")", ":", "if", "not", "isinstance", "(", "index", ",", "CFTimeIndex", ")", ":", "raise", "TypeError", "(", "'index must be a CFTimeIndex, but got '", "'an instance of ...
Obtain the bins and their respective labels for resampling operations. Parameters ---------- index : CFTimeIndex Index object to be resampled (e.g., CFTimeIndex named 'time'). freq : xarray.coding.cftime_offsets.BaseCFTimeOffset The offset object representing target conversion a.k.a. re...
[ "Obtain", "the", "bins", "and", "their", "respective", "labels", "for", "resampling", "operations", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/resample_cftime.py#L104-L164
train
Returns the bin labels and the corresponding datetime_bins for resampling operations.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/resample_cftime.py
_adjust_bin_edges
def _adjust_bin_edges(datetime_bins, offset, closed, index, labels): """This is required for determining the bin edges resampling with daily frequencies greater than one day, month end, and year end frequencies. Consider the following example. Let's say you want to downsample the time series with ...
python
def _adjust_bin_edges(datetime_bins, offset, closed, index, labels): """This is required for determining the bin edges resampling with daily frequencies greater than one day, month end, and year end frequencies. Consider the following example. Let's say you want to downsample the time series with ...
[ "def", "_adjust_bin_edges", "(", "datetime_bins", ",", "offset", ",", "closed", ",", "index", ",", "labels", ")", ":", "is_super_daily", "=", "(", "isinstance", "(", "offset", ",", "(", "MonthEnd", ",", "QuarterEnd", ",", "YearEnd", ")", ")", "or", "(", ...
This is required for determining the bin edges resampling with daily frequencies greater than one day, month end, and year end frequencies. Consider the following example. Let's say you want to downsample the time series with the following coordinates to month end frequency: CFTimeIndex([2000-01-...
[ "This", "is", "required", "for", "determining", "the", "bin", "edges", "resampling", "with", "daily", "frequencies", "greater", "than", "one", "day", "month", "end", "and", "year", "end", "frequencies", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/resample_cftime.py#L167-L212
train
Adjusts the bin edges of a single time series to match the given bin frequencies.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/resample_cftime.py
_get_range_edges
def _get_range_edges(first, last, offset, closed='left', base=0): """ Get the correct starting and ending datetimes for the resampled CFTimeIndex range. Parameters ---------- first : cftime.datetime Uncorrected starting datetime object for resampled CFTimeIndex range. Usually the mi...
python
def _get_range_edges(first, last, offset, closed='left', base=0): """ Get the correct starting and ending datetimes for the resampled CFTimeIndex range. Parameters ---------- first : cftime.datetime Uncorrected starting datetime object for resampled CFTimeIndex range. Usually the mi...
[ "def", "_get_range_edges", "(", "first", ",", "last", ",", "offset", ",", "closed", "=", "'left'", ",", "base", "=", "0", ")", ":", "if", "isinstance", "(", "offset", ",", "CFTIME_TICKS", ")", ":", "first", ",", "last", "=", "_adjust_dates_anchored", "("...
Get the correct starting and ending datetimes for the resampled CFTimeIndex range. Parameters ---------- first : cftime.datetime Uncorrected starting datetime object for resampled CFTimeIndex range. Usually the min of the original CFTimeIndex. last : cftime.datetime Uncorrec...
[ "Get", "the", "correct", "starting", "and", "ending", "datetimes", "for", "the", "resampled", "CFTimeIndex", "range", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/resample_cftime.py#L215-L259
train
Get the correct starting and ending datetimes for the resampled CFTimeIndex range.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/resample_cftime.py
_adjust_dates_anchored
def _adjust_dates_anchored(first, last, offset, closed='right', base=0): """ First and last offsets should be calculated from the start day to fix an error cause by resampling across multiple days when a one day period is not a multiple of the frequency. See https://github.com/pandas-dev/pandas/issues/8...
python
def _adjust_dates_anchored(first, last, offset, closed='right', base=0): """ First and last offsets should be calculated from the start day to fix an error cause by resampling across multiple days when a one day period is not a multiple of the frequency. See https://github.com/pandas-dev/pandas/issues/8...
[ "def", "_adjust_dates_anchored", "(", "first", ",", "last", ",", "offset", ",", "closed", "=", "'right'", ",", "base", "=", "0", ")", ":", "base", "=", "base", "%", "offset", ".", "n", "start_day", "=", "normalize_date", "(", "first", ")", "base_td", "...
First and last offsets should be calculated from the start day to fix an error cause by resampling across multiple days when a one day period is not a multiple of the frequency. See https://github.com/pandas-dev/pandas/issues/8683 Parameters ---------- first : cftime.datetime A datetime...
[ "First", "and", "last", "offsets", "should", "be", "calculated", "from", "the", "start", "day", "to", "fix", "an", "error", "cause", "by", "resampling", "across", "multiple", "days", "when", "a", "one", "day", "period", "is", "not", "a", "multiple", "of", ...
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/resample_cftime.py#L262-L323
train
Adjusts the dates of the first and last time series to fix resampling errors.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/resample_cftime.py
exact_cftime_datetime_difference
def exact_cftime_datetime_difference(a, b): """Exact computation of b - a Assumes: a = a_0 + a_m b = b_0 + b_m Here a_0, and b_0 represent the input dates rounded down to the nearest second, and a_m, and b_m represent the remaining microseconds associated with date a and date ...
python
def exact_cftime_datetime_difference(a, b): """Exact computation of b - a Assumes: a = a_0 + a_m b = b_0 + b_m Here a_0, and b_0 represent the input dates rounded down to the nearest second, and a_m, and b_m represent the remaining microseconds associated with date a and date ...
[ "def", "exact_cftime_datetime_difference", "(", "a", ",", "b", ")", ":", "seconds", "=", "b", ".", "replace", "(", "microsecond", "=", "0", ")", "-", "a", ".", "replace", "(", "microsecond", "=", "0", ")", "seconds", "=", "int", "(", "round", "(", "s...
Exact computation of b - a Assumes: a = a_0 + a_m b = b_0 + b_m Here a_0, and b_0 represent the input dates rounded down to the nearest second, and a_m, and b_m represent the remaining microseconds associated with date a and date b. We can then express the value of b - a as: ...
[ "Exact", "computation", "of", "b", "-", "a" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/resample_cftime.py#L326-L363
train
Exact computation of a and b.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/resample_cftime.py
CFTimeGrouper.first_items
def first_items(self, index): """Meant to reproduce the results of the following grouper = pandas.Grouper(...) first_items = pd.Series(np.arange(len(index)), index).groupby(grouper).first() with index being a CFTimeIndex instead of a DatetimeIndex. ...
python
def first_items(self, index): """Meant to reproduce the results of the following grouper = pandas.Grouper(...) first_items = pd.Series(np.arange(len(index)), index).groupby(grouper).first() with index being a CFTimeIndex instead of a DatetimeIndex. ...
[ "def", "first_items", "(", "self", ",", "index", ")", ":", "datetime_bins", ",", "labels", "=", "_get_time_bins", "(", "index", ",", "self", ".", "freq", ",", "self", ".", "closed", ",", "self", ".", "label", ",", "self", ".", "base", ")", "if", "sel...
Meant to reproduce the results of the following grouper = pandas.Grouper(...) first_items = pd.Series(np.arange(len(index)), index).groupby(grouper).first() with index being a CFTimeIndex instead of a DatetimeIndex.
[ "Meant", "to", "reproduce", "the", "results", "of", "the", "following" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/resample_cftime.py#L71-L101
train
Meant to reproduce the results of the following
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/alignment.py
align
def align(*objects, **kwargs): """align(*objects, join='inner', copy=True, indexes=None, exclude=frozenset()) Given any number of Dataset and/or DataArray objects, returns new objects with aligned indexes and dimension sizes. Array from the aligned objects are suitable as input to mathema...
python
def align(*objects, **kwargs): """align(*objects, join='inner', copy=True, indexes=None, exclude=frozenset()) Given any number of Dataset and/or DataArray objects, returns new objects with aligned indexes and dimension sizes. Array from the aligned objects are suitable as input to mathema...
[ "def", "align", "(", "*", "objects", ",", "*", "*", "kwargs", ")", ":", "join", "=", "kwargs", ".", "pop", "(", "'join'", ",", "'inner'", ")", "copy", "=", "kwargs", ".", "pop", "(", "'copy'", ",", "True", ")", "indexes", "=", "kwargs", ".", "pop...
align(*objects, join='inner', copy=True, indexes=None, exclude=frozenset()) Given any number of Dataset and/or DataArray objects, returns new objects with aligned indexes and dimension sizes. Array from the aligned objects are suitable as input to mathematical operators, because along eac...
[ "align", "(", "*", "objects", "join", "=", "inner", "copy", "=", "True", "indexes", "=", "None", "exclude", "=", "frozenset", "()", ")" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/alignment.py#L37-L169
train
Aligns the objects in the input list with the same size as the input list.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/alignment.py
deep_align
def deep_align(objects, join='inner', copy=True, indexes=None, exclude=frozenset(), raise_on_invalid=True): """Align objects for merging, recursing into dictionary values. This function is not public API. """ from .dataarray import DataArray from .dataset import Dataset if index...
python
def deep_align(objects, join='inner', copy=True, indexes=None, exclude=frozenset(), raise_on_invalid=True): """Align objects for merging, recursing into dictionary values. This function is not public API. """ from .dataarray import DataArray from .dataset import Dataset if index...
[ "def", "deep_align", "(", "objects", ",", "join", "=", "'inner'", ",", "copy", "=", "True", ",", "indexes", "=", "None", ",", "exclude", "=", "frozenset", "(", ")", ",", "raise_on_invalid", "=", "True", ")", ":", "from", ".", "dataarray", "import", "Da...
Align objects for merging, recursing into dictionary values. This function is not public API.
[ "Align", "objects", "for", "merging", "recursing", "into", "dictionary", "values", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/alignment.py#L172-L228
train
Align objects for merging into dictionary values.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/alignment.py
reindex_like_indexers
def reindex_like_indexers(target, other): """Extract indexers to align target with other. Not public API. Parameters ---------- target : Dataset or DataArray Object to be aligned. other : Dataset or DataArray Object to be aligned with. Returns ------- Dict[Any, pan...
python
def reindex_like_indexers(target, other): """Extract indexers to align target with other. Not public API. Parameters ---------- target : Dataset or DataArray Object to be aligned. other : Dataset or DataArray Object to be aligned with. Returns ------- Dict[Any, pan...
[ "def", "reindex_like_indexers", "(", "target", ",", "other", ")", ":", "indexers", "=", "{", "k", ":", "v", "for", "k", ",", "v", "in", "other", ".", "indexes", ".", "items", "(", ")", "if", "k", "in", "target", ".", "dims", "}", "for", "dim", "i...
Extract indexers to align target with other. Not public API. Parameters ---------- target : Dataset or DataArray Object to be aligned. other : Dataset or DataArray Object to be aligned with. Returns ------- Dict[Any, pandas.Index] providing indexes for reindex keyword ...
[ "Extract", "indexers", "to", "align", "target", "with", "other", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/alignment.py#L231-L262
train
Extract indexers to align target with other.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/alignment.py
reindex_variables
def reindex_variables( variables: Mapping[Any, Variable], sizes: Mapping[Any, int], indexes: Mapping[Any, pd.Index], indexers: Mapping, method: Optional[str] = None, tolerance: Any = None, copy: bool = True, ) -> 'Tuple[OrderedDict[Any, Variable], OrderedDict[Any, pd.Index]]': """Conform...
python
def reindex_variables( variables: Mapping[Any, Variable], sizes: Mapping[Any, int], indexes: Mapping[Any, pd.Index], indexers: Mapping, method: Optional[str] = None, tolerance: Any = None, copy: bool = True, ) -> 'Tuple[OrderedDict[Any, Variable], OrderedDict[Any, pd.Index]]': """Conform...
[ "def", "reindex_variables", "(", "variables", ":", "Mapping", "[", "Any", ",", "Variable", "]", ",", "sizes", ":", "Mapping", "[", "Any", ",", "int", "]", ",", "indexes", ":", "Mapping", "[", "Any", ",", "pd", ".", "Index", "]", ",", "indexers", ":",...
Conform a dictionary of aligned variables onto a new set of variables, filling in missing values with NaN. Not public API. Parameters ---------- variables : dict-like Dictionary of xarray.Variable objects. sizes : dict-like Dictionary from dimension names to integer sizes. ...
[ "Conform", "a", "dictionary", "of", "aligned", "variables", "onto", "a", "new", "set", "of", "variables", "filling", "in", "missing", "values", "with", "NaN", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/alignment.py#L265-L394
train
Conform a dictionary of aligned variables onto a new set of variables.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/alignment.py
broadcast
def broadcast(*args, **kwargs): """Explicitly broadcast any number of DataArray or Dataset objects against one another. xarray objects automatically broadcast against each other in arithmetic operations, so this function should not be necessary for normal use. If no change is needed, the input dat...
python
def broadcast(*args, **kwargs): """Explicitly broadcast any number of DataArray or Dataset objects against one another. xarray objects automatically broadcast against each other in arithmetic operations, so this function should not be necessary for normal use. If no change is needed, the input dat...
[ "def", "broadcast", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "from", ".", "dataarray", "import", "DataArray", "from", ".", "dataset", "import", "Dataset", "exclude", "=", "kwargs", ".", "pop", "(", "'exclude'", ",", "None", ")", "if", "excl...
Explicitly broadcast any number of DataArray or Dataset objects against one another. xarray objects automatically broadcast against each other in arithmetic operations, so this function should not be necessary for normal use. If no change is needed, the input data is returned to the output without ...
[ "Explicitly", "broadcast", "any", "number", "of", "DataArray", "or", "Dataset", "objects", "against", "one", "another", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/alignment.py#L397-L524
train
Explicitly broadcast any number of DataArray or Dataset objects against one another.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/coordinates.py
assert_coordinate_consistent
def assert_coordinate_consistent(obj, coords): """ Maeke sure the dimension coordinate of obj is consistent with coords. obj: DataArray or Dataset coords: Dict-like of variables """ for k in obj.dims: # make sure there are no conflict in dimension coordinates if k in coords and ...
python
def assert_coordinate_consistent(obj, coords): """ Maeke sure the dimension coordinate of obj is consistent with coords. obj: DataArray or Dataset coords: Dict-like of variables """ for k in obj.dims: # make sure there are no conflict in dimension coordinates if k in coords and ...
[ "def", "assert_coordinate_consistent", "(", "obj", ",", "coords", ")", ":", "for", "k", "in", "obj", ".", "dims", ":", "# make sure there are no conflict in dimension coordinates", "if", "k", "in", "coords", "and", "k", "in", "obj", ".", "coords", ":", "if", "...
Maeke sure the dimension coordinate of obj is consistent with coords. obj: DataArray or Dataset coords: Dict-like of variables
[ "Maeke", "sure", "the", "dimension", "coordinate", "of", "obj", "is", "consistent", "with", "coords", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/coordinates.py#L279-L293
train
Maeke sure the dimension coordinate of obj is consistent with coords.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/coordinates.py
remap_label_indexers
def remap_label_indexers(obj, indexers=None, method=None, tolerance=None, **indexers_kwargs): """ Remap **indexers from obj.coords. If indexer is an instance of DataArray and it has coordinate, then this coordinate will be attached to pos_indexers. Returns ------- p...
python
def remap_label_indexers(obj, indexers=None, method=None, tolerance=None, **indexers_kwargs): """ Remap **indexers from obj.coords. If indexer is an instance of DataArray and it has coordinate, then this coordinate will be attached to pos_indexers. Returns ------- p...
[ "def", "remap_label_indexers", "(", "obj", ",", "indexers", "=", "None", ",", "method", "=", "None", ",", "tolerance", "=", "None", ",", "*", "*", "indexers_kwargs", ")", ":", "from", ".", "dataarray", "import", "DataArray", "indexers", "=", "either_dict_or_...
Remap **indexers from obj.coords. If indexer is an instance of DataArray and it has coordinate, then this coordinate will be attached to pos_indexers. Returns ------- pos_indexers: Same type of indexers. np.ndarray or Variable or DataArra new_indexes: mapping of new dimensional-coordina...
[ "Remap", "**", "indexers", "from", "obj", ".", "coords", ".", "If", "indexer", "is", "an", "instance", "of", "DataArray", "and", "it", "has", "coordinate", "then", "this", "coordinate", "will", "be", "attached", "to", "pos_indexers", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/coordinates.py#L296-L330
train
Remap indexers from obj. coords to new dimensions.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/coordinates.py
AbstractCoordinates.to_index
def to_index(self, ordered_dims=None): """Convert all index coordinates into a :py:class:`pandas.Index`. Parameters ---------- ordered_dims : sequence, optional Possibly reordered version of this object's dimensions indicating the order in which dimensions should...
python
def to_index(self, ordered_dims=None): """Convert all index coordinates into a :py:class:`pandas.Index`. Parameters ---------- ordered_dims : sequence, optional Possibly reordered version of this object's dimensions indicating the order in which dimensions should...
[ "def", "to_index", "(", "self", ",", "ordered_dims", "=", "None", ")", ":", "if", "ordered_dims", "is", "None", ":", "ordered_dims", "=", "self", ".", "dims", "elif", "set", "(", "ordered_dims", ")", "!=", "set", "(", "self", ".", "dims", ")", ":", "...
Convert all index coordinates into a :py:class:`pandas.Index`. Parameters ---------- ordered_dims : sequence, optional Possibly reordered version of this object's dimensions indicating the order in which dimensions should appear on the result. Returns --...
[ "Convert", "all", "index", "coordinates", "into", "a", ":", "py", ":", "class", ":", "pandas", ".", "Index", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/coordinates.py#L55-L85
train
Convert all index coordinates into a pandas. Index.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/coordinates.py
AbstractCoordinates._merge_raw
def _merge_raw(self, other): """For use with binary arithmetic.""" if other is None: variables = OrderedDict(self.variables) else: # don't align because we already called xarray.align variables = expand_and_merge_variables( [self.variables, oth...
python
def _merge_raw(self, other): """For use with binary arithmetic.""" if other is None: variables = OrderedDict(self.variables) else: # don't align because we already called xarray.align variables = expand_and_merge_variables( [self.variables, oth...
[ "def", "_merge_raw", "(", "self", ",", "other", ")", ":", "if", "other", "is", "None", ":", "variables", "=", "OrderedDict", "(", "self", ".", "variables", ")", "else", ":", "# don't align because we already called xarray.align", "variables", "=", "expand_and_merg...
For use with binary arithmetic.
[ "For", "use", "with", "binary", "arithmetic", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/coordinates.py#L93-L101
train
For use with binary arithmetic.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/coordinates.py
AbstractCoordinates._merge_inplace
def _merge_inplace(self, other): """For use with in-place binary arithmetic.""" if other is None: yield else: # don't include indexes in priority_vars, because we didn't align # first priority_vars = OrderedDict( kv for kv in self.v...
python
def _merge_inplace(self, other): """For use with in-place binary arithmetic.""" if other is None: yield else: # don't include indexes in priority_vars, because we didn't align # first priority_vars = OrderedDict( kv for kv in self.v...
[ "def", "_merge_inplace", "(", "self", ",", "other", ")", ":", "if", "other", "is", "None", ":", "yield", "else", ":", "# don't include indexes in priority_vars, because we didn't align", "# first", "priority_vars", "=", "OrderedDict", "(", "kv", "for", "kv", "in", ...
For use with in-place binary arithmetic.
[ "For", "use", "with", "in", "-", "place", "binary", "arithmetic", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/coordinates.py#L104-L116
train
For use with in - place binary arithmetic.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/coordinates.py
AbstractCoordinates.merge
def merge(self, other): """Merge two sets of coordinates to create a new Dataset The method implements the logic used for joining coordinates in the result of a binary operation performed on xarray objects: - If two index coordinates conflict (are not equal), an exception is ...
python
def merge(self, other): """Merge two sets of coordinates to create a new Dataset The method implements the logic used for joining coordinates in the result of a binary operation performed on xarray objects: - If two index coordinates conflict (are not equal), an exception is ...
[ "def", "merge", "(", "self", ",", "other", ")", ":", "from", ".", "dataset", "import", "Dataset", "if", "other", "is", "None", ":", "return", "self", ".", "to_dataset", "(", ")", "else", ":", "other_vars", "=", "getattr", "(", "other", ",", "'variables...
Merge two sets of coordinates to create a new Dataset The method implements the logic used for joining coordinates in the result of a binary operation performed on xarray objects: - If two index coordinates conflict (are not equal), an exception is raised. You must align your data be...
[ "Merge", "two", "sets", "of", "coordinates", "to", "create", "a", "new", "Dataset" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/coordinates.py#L118-L147
train
This method merges two sets of coordinates to create a new Dataset object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/coordinates.py
DatasetCoordinates._ipython_key_completions_
def _ipython_key_completions_(self): """Provide method for the key-autocompletions in IPython. """ return [key for key in self._data._ipython_key_completions_() if key not in self._data.data_vars]
python
def _ipython_key_completions_(self): """Provide method for the key-autocompletions in IPython. """ return [key for key in self._data._ipython_key_completions_() if key not in self._data.data_vars]
[ "def", "_ipython_key_completions_", "(", "self", ")", ":", "return", "[", "key", "for", "key", "in", "self", ".", "_data", ".", "_ipython_key_completions_", "(", ")", "if", "key", "not", "in", "self", ".", "_data", ".", "data_vars", "]" ]
Provide method for the key-autocompletions in IPython.
[ "Provide", "method", "for", "the", "key", "-", "autocompletions", "in", "IPython", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/coordinates.py#L205-L208
train
Provide method for the key - completerions in IPython.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/dask_array_ops.py
dask_rolling_wrapper
def dask_rolling_wrapper(moving_func, a, window, min_count=None, axis=-1): '''wrapper to apply bottleneck moving window funcs on dask arrays''' dtype, fill_value = dtypes.maybe_promote(a.dtype) a = a.astype(dtype) # inputs for overlap if axis < 0: axis = a.ndim + axis depth = {d: 0 for d...
python
def dask_rolling_wrapper(moving_func, a, window, min_count=None, axis=-1): '''wrapper to apply bottleneck moving window funcs on dask arrays''' dtype, fill_value = dtypes.maybe_promote(a.dtype) a = a.astype(dtype) # inputs for overlap if axis < 0: axis = a.ndim + axis depth = {d: 0 for d...
[ "def", "dask_rolling_wrapper", "(", "moving_func", ",", "a", ",", "window", ",", "min_count", "=", "None", ",", "axis", "=", "-", "1", ")", ":", "dtype", ",", "fill_value", "=", "dtypes", ".", "maybe_promote", "(", "a", ".", "dtype", ")", "a", "=", "...
wrapper to apply bottleneck moving window funcs on dask arrays
[ "wrapper", "to", "apply", "bottleneck", "moving", "window", "funcs", "on", "dask", "arrays" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dask_array_ops.py#L21-L38
train
wrapper to apply bottleneck moving window funcs on dask arrays
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/dask_array_ops.py
rolling_window
def rolling_window(a, axis, window, center, fill_value): """ Dask's equivalence to np.utils.rolling_window """ orig_shape = a.shape if axis < 0: axis = a.ndim + axis depth = {d: 0 for d in range(a.ndim)} depth[axis] = int(window / 2) # For evenly sized window, we need to crop the first p...
python
def rolling_window(a, axis, window, center, fill_value): """ Dask's equivalence to np.utils.rolling_window """ orig_shape = a.shape if axis < 0: axis = a.ndim + axis depth = {d: 0 for d in range(a.ndim)} depth[axis] = int(window / 2) # For evenly sized window, we need to crop the first p...
[ "def", "rolling_window", "(", "a", ",", "axis", ",", "window", ",", "center", ",", "fill_value", ")", ":", "orig_shape", "=", "a", ".", "shape", "if", "axis", "<", "0", ":", "axis", "=", "a", ".", "ndim", "+", "axis", "depth", "=", "{", "d", ":",...
Dask's equivalence to np.utils.rolling_window
[ "Dask", "s", "equivalence", "to", "np", ".", "utils", ".", "rolling_window" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dask_array_ops.py#L41-L104
train
Dask s equivalence to np. utils. rolling_window
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/backends/zarr.py
_determine_zarr_chunks
def _determine_zarr_chunks(enc_chunks, var_chunks, ndim): """ Given encoding chunks (possibly None) and variable chunks (possibly None) """ # zarr chunk spec: # chunks : int or tuple of ints, optional # Chunk shape. If not provided, will be guessed from shape and dtype. # if there are no...
python
def _determine_zarr_chunks(enc_chunks, var_chunks, ndim): """ Given encoding chunks (possibly None) and variable chunks (possibly None) """ # zarr chunk spec: # chunks : int or tuple of ints, optional # Chunk shape. If not provided, will be guessed from shape and dtype. # if there are no...
[ "def", "_determine_zarr_chunks", "(", "enc_chunks", ",", "var_chunks", ",", "ndim", ")", ":", "# zarr chunk spec:", "# chunks : int or tuple of ints, optional", "# Chunk shape. If not provided, will be guessed from shape and dtype.", "# if there are no chunks in encoding and the variable...
Given encoding chunks (possibly None) and variable chunks (possibly None)
[ "Given", "encoding", "chunks", "(", "possibly", "None", ")", "and", "variable", "chunks", "(", "possibly", "None", ")" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/backends/zarr.py#L59-L147
train
Determines the size of the zarr array based on the encoding and variable data.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/backends/zarr.py
encode_zarr_variable
def encode_zarr_variable(var, needs_copy=True, name=None): """ Converts an Variable into an Variable which follows some of the CF conventions: - Nans are masked using _FillValue (or the deprecated missing_value) - Rescaling via: scale_factor and add_offset - datetimes are converted ...
python
def encode_zarr_variable(var, needs_copy=True, name=None): """ Converts an Variable into an Variable which follows some of the CF conventions: - Nans are masked using _FillValue (or the deprecated missing_value) - Rescaling via: scale_factor and add_offset - datetimes are converted ...
[ "def", "encode_zarr_variable", "(", "var", ",", "needs_copy", "=", "True", ",", "name", "=", "None", ")", ":", "var", "=", "conventions", ".", "encode_cf_variable", "(", "var", ",", "name", "=", "name", ")", "# zarr allows unicode, but not variable-length strings,...
Converts an Variable into an Variable which follows some of the CF conventions: - Nans are masked using _FillValue (or the deprecated missing_value) - Rescaling via: scale_factor and add_offset - datetimes are converted to the CF 'units since time' format - dtype encodings are enfor...
[ "Converts", "an", "Variable", "into", "an", "Variable", "which", "follows", "some", "of", "the", "CF", "conventions", ":" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/backends/zarr.py#L189-L219
train
Encodes a variable into a zarr - compatible variable.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/backends/zarr.py
open_zarr
def open_zarr(store, group=None, synchronizer=None, chunks='auto', decode_cf=True, mask_and_scale=True, decode_times=True, concat_characters=True, decode_coords=True, drop_variables=None, consolidated=False, overwrite_encoded_chunks=False, **kwargs): """Load a...
python
def open_zarr(store, group=None, synchronizer=None, chunks='auto', decode_cf=True, mask_and_scale=True, decode_times=True, concat_characters=True, decode_coords=True, drop_variables=None, consolidated=False, overwrite_encoded_chunks=False, **kwargs): """Load a...
[ "def", "open_zarr", "(", "store", ",", "group", "=", "None", ",", "synchronizer", "=", "None", ",", "chunks", "=", "'auto'", ",", "decode_cf", "=", "True", ",", "mask_and_scale", "=", "True", ",", "decode_times", "=", "True", ",", "concat_characters", "=",...
Load and decode a dataset from a Zarr store. .. note:: Experimental The Zarr backend is new and experimental. Please report any unexpected behavior via github issues. The `store` object should be a valid store for a Zarr group. `store` variables must contain dimension metadata ...
[ "Load", "and", "decode", "a", "dataset", "from", "a", "Zarr", "store", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/backends/zarr.py#L356-L533
train
Load and decode a dataset from a Zarr store.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/merge.py
broadcast_dimension_size
def broadcast_dimension_size( variables: List[Variable], ) -> 'OrderedDict[Any, int]': """Extract dimension sizes from a dictionary of variables. Raises ValueError if any dimensions have different sizes. """ dims = OrderedDict() # type: OrderedDict[Any, int] for var in variables: for d...
python
def broadcast_dimension_size( variables: List[Variable], ) -> 'OrderedDict[Any, int]': """Extract dimension sizes from a dictionary of variables. Raises ValueError if any dimensions have different sizes. """ dims = OrderedDict() # type: OrderedDict[Any, int] for var in variables: for d...
[ "def", "broadcast_dimension_size", "(", "variables", ":", "List", "[", "Variable", "]", ",", ")", "->", "'OrderedDict[Any, int]'", ":", "dims", "=", "OrderedDict", "(", ")", "# type: OrderedDict[Any, int]", "for", "var", "in", "variables", ":", "for", "dim", ","...
Extract dimension sizes from a dictionary of variables. Raises ValueError if any dimensions have different sizes.
[ "Extract", "dimension", "sizes", "from", "a", "dictionary", "of", "variables", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/merge.py#L26-L39
train
Extract dimension sizes from a dictionary of variables.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/merge.py
unique_variable
def unique_variable(name, variables, compat='broadcast_equals'): # type: (Any, List[Variable], str) -> Variable """Return the unique variable from a list of variables or raise MergeError. Parameters ---------- name : hashable Name for this variable. variables : list of xarray.Variable ...
python
def unique_variable(name, variables, compat='broadcast_equals'): # type: (Any, List[Variable], str) -> Variable """Return the unique variable from a list of variables or raise MergeError. Parameters ---------- name : hashable Name for this variable. variables : list of xarray.Variable ...
[ "def", "unique_variable", "(", "name", ",", "variables", ",", "compat", "=", "'broadcast_equals'", ")", ":", "# type: (Any, List[Variable], str) -> Variable", "# noqa", "out", "=", "variables", "[", "0", "]", "if", "len", "(", "variables", ")", ">", "1", ":", ...
Return the unique variable from a list of variables or raise MergeError. Parameters ---------- name : hashable Name for this variable. variables : list of xarray.Variable List of Variable objects, all of which go by the same name in different inputs. compat : {'identical', '...
[ "Return", "the", "unique", "variable", "from", "a", "list", "of", "variables", "or", "raise", "MergeError", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/merge.py#L49-L96
train
Returns the unique variable from a list of variables.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/merge.py
merge_variables
def merge_variables( list_of_variables_dicts, # type: List[Mapping[Any, Variable]] priority_vars=None, # type: Optional[Mapping[Any, Variable]] compat='minimal', # type: str ): # type: (...) -> OrderedDict[Any, Variable] """Merge dicts of variables, while resolving conflic...
python
def merge_variables( list_of_variables_dicts, # type: List[Mapping[Any, Variable]] priority_vars=None, # type: Optional[Mapping[Any, Variable]] compat='minimal', # type: str ): # type: (...) -> OrderedDict[Any, Variable] """Merge dicts of variables, while resolving conflic...
[ "def", "merge_variables", "(", "list_of_variables_dicts", ",", "# type: List[Mapping[Any, Variable]]", "priority_vars", "=", "None", ",", "# type: Optional[Mapping[Any, Variable]]", "compat", "=", "'minimal'", ",", "# type: str", ")", ":", "# type: (...) -> OrderedDict[Any, Varia...
Merge dicts of variables, while resolving conflicts appropriately. Parameters ---------- lists_of_variables_dicts : list of mappings with Variable values List of mappings for which each value is a xarray.Variable object. priority_vars : mapping with Variable or None values, optional If ...
[ "Merge", "dicts", "of", "variables", "while", "resolving", "conflicts", "appropriately", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/merge.py#L117-L177
train
Merges the variables in the list of variables_dicts into a single dict.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/merge.py
expand_variable_dicts
def expand_variable_dicts( list_of_variable_dicts: 'List[Union[Dataset, OrderedDict]]', ) -> 'List[Mapping[Any, Variable]]': """Given a list of dicts with xarray object values, expand the values. Parameters ---------- list_of_variable_dicts : list of dict or Dataset objects Each value for t...
python
def expand_variable_dicts( list_of_variable_dicts: 'List[Union[Dataset, OrderedDict]]', ) -> 'List[Mapping[Any, Variable]]': """Given a list of dicts with xarray object values, expand the values. Parameters ---------- list_of_variable_dicts : list of dict or Dataset objects Each value for t...
[ "def", "expand_variable_dicts", "(", "list_of_variable_dicts", ":", "'List[Union[Dataset, OrderedDict]]'", ",", ")", "->", "'List[Mapping[Any, Variable]]'", ":", "from", ".", "dataarray", "import", "DataArray", "from", ".", "dataset", "import", "Dataset", "var_dicts", "="...
Given a list of dicts with xarray object values, expand the values. Parameters ---------- list_of_variable_dicts : list of dict or Dataset objects Each value for the mappings must be of the following types: - an xarray.Variable - a tuple `(dims, data[, attrs[, encoding]])` that can ...
[ "Given", "a", "list", "of", "dicts", "with", "xarray", "object", "values", "expand", "the", "values", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/merge.py#L180-L227
train
Given a list of dicts with xarray object values expand the values.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/merge.py
determine_coords
def determine_coords(list_of_variable_dicts): # type: (List[Dict]) -> Tuple[Set, Set] """Given a list of dicts with xarray object values, identify coordinates. Parameters ---------- list_of_variable_dicts : list of dict or Dataset objects Of the same form as the arguments to expand_variable...
python
def determine_coords(list_of_variable_dicts): # type: (List[Dict]) -> Tuple[Set, Set] """Given a list of dicts with xarray object values, identify coordinates. Parameters ---------- list_of_variable_dicts : list of dict or Dataset objects Of the same form as the arguments to expand_variable...
[ "def", "determine_coords", "(", "list_of_variable_dicts", ")", ":", "# type: (List[Dict]) -> Tuple[Set, Set]", "from", ".", "dataarray", "import", "DataArray", "from", ".", "dataset", "import", "Dataset", "coord_names", "=", "set", "(", ")", "# type: set", "noncoord_nam...
Given a list of dicts with xarray object values, identify coordinates. Parameters ---------- list_of_variable_dicts : list of dict or Dataset objects Of the same form as the arguments to expand_variable_dicts. Returns ------- coord_names : set of variable names noncoord_names : set...
[ "Given", "a", "list", "of", "dicts", "with", "xarray", "object", "values", "identify", "coordinates", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/merge.py#L230-L264
train
Given a list of dicts with xarray object values identify coordinates.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/merge.py
coerce_pandas_values
def coerce_pandas_values(objects): """Convert pandas values found in a list of labeled objects. Parameters ---------- objects : list of Dataset or mappings The mappings may contain any sort of objects coercible to xarray.Variables as keys, including pandas objects. Returns ----...
python
def coerce_pandas_values(objects): """Convert pandas values found in a list of labeled objects. Parameters ---------- objects : list of Dataset or mappings The mappings may contain any sort of objects coercible to xarray.Variables as keys, including pandas objects. Returns ----...
[ "def", "coerce_pandas_values", "(", "objects", ")", ":", "from", ".", "dataset", "import", "Dataset", "from", ".", "dataarray", "import", "DataArray", "out", "=", "[", "]", "for", "obj", "in", "objects", ":", "if", "isinstance", "(", "obj", ",", "Dataset",...
Convert pandas values found in a list of labeled objects. Parameters ---------- objects : list of Dataset or mappings The mappings may contain any sort of objects coercible to xarray.Variables as keys, including pandas objects. Returns ------- List of Dataset or OrderedDict obj...
[ "Convert", "pandas", "values", "found", "in", "a", "list", "of", "labeled", "objects", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/merge.py#L267-L297
train
Convert pandas values found in a list of labeled objects into native xarray objects.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/merge.py
merge_coords_for_inplace_math
def merge_coords_for_inplace_math(objs, priority_vars=None): """Merge coordinate variables without worrying about alignment. This function is used for merging variables in coordinates.py. """ expanded = expand_variable_dicts(objs) variables = merge_variables(expanded, priority_vars) assert_uniq...
python
def merge_coords_for_inplace_math(objs, priority_vars=None): """Merge coordinate variables without worrying about alignment. This function is used for merging variables in coordinates.py. """ expanded = expand_variable_dicts(objs) variables = merge_variables(expanded, priority_vars) assert_uniq...
[ "def", "merge_coords_for_inplace_math", "(", "objs", ",", "priority_vars", "=", "None", ")", ":", "expanded", "=", "expand_variable_dicts", "(", "objs", ")", "variables", "=", "merge_variables", "(", "expanded", ",", "priority_vars", ")", "assert_unique_multiindex_lev...
Merge coordinate variables without worrying about alignment. This function is used for merging variables in coordinates.py.
[ "Merge", "coordinate", "variables", "without", "worrying", "about", "alignment", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/merge.py#L300-L308
train
This function is used to merge coordinate variables without worrying about alignment.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/merge.py
_get_priority_vars
def _get_priority_vars(objects, priority_arg, compat='equals'): """Extract the priority variable from a list of mappings. We need this method because in some cases the priority argument itself might have conflicting values (e.g., if it is a dict with two DataArray values with conflicting coordinate val...
python
def _get_priority_vars(objects, priority_arg, compat='equals'): """Extract the priority variable from a list of mappings. We need this method because in some cases the priority argument itself might have conflicting values (e.g., if it is a dict with two DataArray values with conflicting coordinate val...
[ "def", "_get_priority_vars", "(", "objects", ",", "priority_arg", ",", "compat", "=", "'equals'", ")", ":", "# noqa", "if", "priority_arg", "is", "None", ":", "priority_vars", "=", "{", "}", "else", ":", "expanded", "=", "expand_variable_dicts", "(", "[", "o...
Extract the priority variable from a list of mappings. We need this method because in some cases the priority argument itself might have conflicting values (e.g., if it is a dict with two DataArray values with conflicting coordinate values). Parameters ---------- objects : list of dictionaries...
[ "Extract", "the", "priority", "variable", "from", "a", "list", "of", "mappings", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/merge.py#L311-L337
train
This method extracts the priority variable from a list of mappings.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/merge.py
expand_and_merge_variables
def expand_and_merge_variables(objs, priority_arg=None): """Merge coordinate variables without worrying about alignment. This function is used for merging variables in computation.py. """ expanded = expand_variable_dicts(objs) priority_vars = _get_priority_vars(objs, priority_arg) variables = m...
python
def expand_and_merge_variables(objs, priority_arg=None): """Merge coordinate variables without worrying about alignment. This function is used for merging variables in computation.py. """ expanded = expand_variable_dicts(objs) priority_vars = _get_priority_vars(objs, priority_arg) variables = m...
[ "def", "expand_and_merge_variables", "(", "objs", ",", "priority_arg", "=", "None", ")", ":", "expanded", "=", "expand_variable_dicts", "(", "objs", ")", "priority_vars", "=", "_get_priority_vars", "(", "objs", ",", "priority_arg", ")", "variables", "=", "merge_va...
Merge coordinate variables without worrying about alignment. This function is used for merging variables in computation.py.
[ "Merge", "coordinate", "variables", "without", "worrying", "about", "alignment", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/merge.py#L340-L348
train
Expand variables with worrying about alignment.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/merge.py
merge_coords
def merge_coords(objs, compat='minimal', join='outer', priority_arg=None, indexes=None): """Merge coordinate variables. See merge_core below for argument descriptions. This works similarly to merge_core, except everything we don't worry about whether variables are coordinates or not. ...
python
def merge_coords(objs, compat='minimal', join='outer', priority_arg=None, indexes=None): """Merge coordinate variables. See merge_core below for argument descriptions. This works similarly to merge_core, except everything we don't worry about whether variables are coordinates or not. ...
[ "def", "merge_coords", "(", "objs", ",", "compat", "=", "'minimal'", ",", "join", "=", "'outer'", ",", "priority_arg", "=", "None", ",", "indexes", "=", "None", ")", ":", "_assert_compat_valid", "(", "compat", ")", "coerced", "=", "coerce_pandas_values", "("...
Merge coordinate variables. See merge_core below for argument descriptions. This works similarly to merge_core, except everything we don't worry about whether variables are coordinates or not.
[ "Merge", "coordinate", "variables", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/merge.py#L351-L367
train
Merge coordinate variables.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/merge.py
merge_data_and_coords
def merge_data_and_coords(data, coords, compat='broadcast_equals', join='outer'): """Used in Dataset.__init__.""" objs = [data, coords] explicit_coords = coords.keys() indexes = dict(extract_indexes(coords)) return merge_core(objs, compat, join, explicit_coords=explicit_coo...
python
def merge_data_and_coords(data, coords, compat='broadcast_equals', join='outer'): """Used in Dataset.__init__.""" objs = [data, coords] explicit_coords = coords.keys() indexes = dict(extract_indexes(coords)) return merge_core(objs, compat, join, explicit_coords=explicit_coo...
[ "def", "merge_data_and_coords", "(", "data", ",", "coords", ",", "compat", "=", "'broadcast_equals'", ",", "join", "=", "'outer'", ")", ":", "objs", "=", "[", "data", ",", "coords", "]", "explicit_coords", "=", "coords", ".", "keys", "(", ")", "indexes", ...
Used in Dataset.__init__.
[ "Used", "in", "Dataset", ".", "__init__", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/merge.py#L370-L377
train
Used in Dataset. __init__.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/merge.py
extract_indexes
def extract_indexes(coords): """Yields the name & index of valid indexes from a mapping of coords""" for name, variable in coords.items(): variable = as_variable(variable, name=name) if variable.dims == (name,): yield name, variable.to_index()
python
def extract_indexes(coords): """Yields the name & index of valid indexes from a mapping of coords""" for name, variable in coords.items(): variable = as_variable(variable, name=name) if variable.dims == (name,): yield name, variable.to_index()
[ "def", "extract_indexes", "(", "coords", ")", ":", "for", "name", ",", "variable", "in", "coords", ".", "items", "(", ")", ":", "variable", "=", "as_variable", "(", "variable", ",", "name", "=", "name", ")", "if", "variable", ".", "dims", "==", "(", ...
Yields the name & index of valid indexes from a mapping of coords
[ "Yields", "the", "name", "&", "index", "of", "valid", "indexes", "from", "a", "mapping", "of", "coords" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/merge.py#L380-L385
train
Yields the name & index of valid indexes from a mapping of coords
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/merge.py
assert_valid_explicit_coords
def assert_valid_explicit_coords(variables, dims, explicit_coords): """Validate explicit coordinate names/dims. Raise a MergeError if an explicit coord shares a name with a dimension but is comprised of arbitrary dimensions. """ for coord_name in explicit_coords: if coord_name in dims and v...
python
def assert_valid_explicit_coords(variables, dims, explicit_coords): """Validate explicit coordinate names/dims. Raise a MergeError if an explicit coord shares a name with a dimension but is comprised of arbitrary dimensions. """ for coord_name in explicit_coords: if coord_name in dims and v...
[ "def", "assert_valid_explicit_coords", "(", "variables", ",", "dims", ",", "explicit_coords", ")", ":", "for", "coord_name", "in", "explicit_coords", ":", "if", "coord_name", "in", "dims", "and", "variables", "[", "coord_name", "]", ".", "dims", "!=", "(", "co...
Validate explicit coordinate names/dims. Raise a MergeError if an explicit coord shares a name with a dimension but is comprised of arbitrary dimensions.
[ "Validate", "explicit", "coordinate", "names", "/", "dims", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/merge.py#L388-L399
train
Validate explicit coordinates.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/merge.py
merge_core
def merge_core(objs, compat='broadcast_equals', join='outer', priority_arg=None, explicit_coords=None, indexes=None): """Core logic for merging labeled objects. This is not public API. Parameters ---------- objs : list of m...
python
def merge_core(objs, compat='broadcast_equals', join='outer', priority_arg=None, explicit_coords=None, indexes=None): """Core logic for merging labeled objects. This is not public API. Parameters ---------- objs : list of m...
[ "def", "merge_core", "(", "objs", ",", "compat", "=", "'broadcast_equals'", ",", "join", "=", "'outer'", ",", "priority_arg", "=", "None", ",", "explicit_coords", "=", "None", ",", "indexes", "=", "None", ")", ":", "# noqa", "from", ".", "dataset", "import...
Core logic for merging labeled objects. This is not public API. Parameters ---------- objs : list of mappings All values must be convertable to labeled arrays. compat : {'identical', 'equals', 'broadcast_equals', 'no_conflicts'}, optional Compatibility checks to use when merging va...
[ "Core", "logic", "for", "merging", "labeled", "objects", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/merge.py#L402-L470
train
This function is not public API. It will merge labeled arrays.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/merge.py
merge
def merge(objects, compat='no_conflicts', join='outer'): """Merge any number of xarray objects into a single Dataset as variables. Parameters ---------- objects : Iterable[Union[xarray.Dataset, xarray.DataArray, dict]] Merge together all variables from these objects. If any of them are ...
python
def merge(objects, compat='no_conflicts', join='outer'): """Merge any number of xarray objects into a single Dataset as variables. Parameters ---------- objects : Iterable[Union[xarray.Dataset, xarray.DataArray, dict]] Merge together all variables from these objects. If any of them are ...
[ "def", "merge", "(", "objects", ",", "compat", "=", "'no_conflicts'", ",", "join", "=", "'outer'", ")", ":", "# noqa", "from", ".", "dataarray", "import", "DataArray", "from", ".", "dataset", "import", "Dataset", "dict_like_objects", "=", "[", "obj", ".", ...
Merge any number of xarray objects into a single Dataset as variables. Parameters ---------- objects : Iterable[Union[xarray.Dataset, xarray.DataArray, dict]] Merge together all variables from these objects. If any of them are DataArray objects, they must have a name. compat : {'identic...
[ "Merge", "any", "number", "of", "xarray", "objects", "into", "a", "single", "Dataset", "as", "variables", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/merge.py#L473-L537
train
Merge any number of xarray objects into a single Dataset.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/merge.py
dataset_merge_method
def dataset_merge_method(dataset, other, overwrite_vars, compat, join): """Guts of the Dataset.merge method.""" # we are locked into supporting overwrite_vars for the Dataset.merge # method due for backwards compatibility # TODO: consider deprecating it? if isinstance(overwrite_vars, str): ...
python
def dataset_merge_method(dataset, other, overwrite_vars, compat, join): """Guts of the Dataset.merge method.""" # we are locked into supporting overwrite_vars for the Dataset.merge # method due for backwards compatibility # TODO: consider deprecating it? if isinstance(overwrite_vars, str): ...
[ "def", "dataset_merge_method", "(", "dataset", ",", "other", ",", "overwrite_vars", ",", "compat", ",", "join", ")", ":", "# we are locked into supporting overwrite_vars for the Dataset.merge", "# method due for backwards compatibility", "# TODO: consider deprecating it?", "if", ...
Guts of the Dataset.merge method.
[ "Guts", "of", "the", "Dataset", ".", "merge", "method", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/merge.py#L540-L568
train
Guts of the Dataset. merge method.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/merge.py
dataset_update_method
def dataset_update_method(dataset, other): """Guts of the Dataset.update method. This drops a duplicated coordinates from `other` if `other` is not an `xarray.Dataset`, e.g., if it's a dict with DataArray values (GH2068, GH2180). """ from .dataset import Dataset from .dataarray import DataA...
python
def dataset_update_method(dataset, other): """Guts of the Dataset.update method. This drops a duplicated coordinates from `other` if `other` is not an `xarray.Dataset`, e.g., if it's a dict with DataArray values (GH2068, GH2180). """ from .dataset import Dataset from .dataarray import DataA...
[ "def", "dataset_update_method", "(", "dataset", ",", "other", ")", ":", "from", ".", "dataset", "import", "Dataset", "from", ".", "dataarray", "import", "DataArray", "if", "not", "isinstance", "(", "other", ",", "Dataset", ")", ":", "other", "=", "OrderedDic...
Guts of the Dataset.update method. This drops a duplicated coordinates from `other` if `other` is not an `xarray.Dataset`, e.g., if it's a dict with DataArray values (GH2068, GH2180).
[ "Guts", "of", "the", "Dataset", ".", "update", "method", "." ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/merge.py#L571-L592
train
Guts of the Dataset. update method.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/nanops.py
_replace_nan
def _replace_nan(a, val): """ replace nan in a by val, and returns the replaced array and the nan position """ mask = isnull(a) return where_method(val, mask, a), mask
python
def _replace_nan(a, val): """ replace nan in a by val, and returns the replaced array and the nan position """ mask = isnull(a) return where_method(val, mask, a), mask
[ "def", "_replace_nan", "(", "a", ",", "val", ")", ":", "mask", "=", "isnull", "(", "a", ")", "return", "where_method", "(", "val", ",", "mask", ",", "a", ")", ",", "mask" ]
replace nan in a by val, and returns the replaced array and the nan position
[ "replace", "nan", "in", "a", "by", "val", "and", "returns", "the", "replaced", "array", "and", "the", "nan", "position" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/nanops.py#L14-L20
train
replace nan in a by val and returns the replaced array and the nan position
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/nanops.py
_maybe_null_out
def _maybe_null_out(result, axis, mask, min_count=1): """ xarray version of pandas.core.nanops._maybe_null_out """ if hasattr(axis, '__len__'): # if tuple or list raise ValueError('min_count is not available for reduction ' 'with more than one dimensions.') if axis...
python
def _maybe_null_out(result, axis, mask, min_count=1): """ xarray version of pandas.core.nanops._maybe_null_out """ if hasattr(axis, '__len__'): # if tuple or list raise ValueError('min_count is not available for reduction ' 'with more than one dimensions.') if axis...
[ "def", "_maybe_null_out", "(", "result", ",", "axis", ",", "mask", ",", "min_count", "=", "1", ")", ":", "if", "hasattr", "(", "axis", ",", "'__len__'", ")", ":", "# if tuple or list", "raise", "ValueError", "(", "'min_count is not available for reduction '", "'...
xarray version of pandas.core.nanops._maybe_null_out
[ "xarray", "version", "of", "pandas", ".", "core", ".", "nanops", ".", "_maybe_null_out" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/nanops.py#L23-L43
train
Internal function to handle null out of an array.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
pydata/xarray
xarray/core/nanops.py
_nan_argminmax_object
def _nan_argminmax_object(func, fill_value, value, axis=None, **kwargs): """ In house nanargmin, nanargmax for object arrays. Always return integer type """ valid_count = count(value, axis=axis) value = fillna(value, fill_value) data = _dask_or_eager_func(func)(value, axis=axis, **kwargs) #...
python
def _nan_argminmax_object(func, fill_value, value, axis=None, **kwargs): """ In house nanargmin, nanargmax for object arrays. Always return integer type """ valid_count = count(value, axis=axis) value = fillna(value, fill_value) data = _dask_or_eager_func(func)(value, axis=axis, **kwargs) #...
[ "def", "_nan_argminmax_object", "(", "func", ",", "fill_value", ",", "value", ",", "axis", "=", "None", ",", "*", "*", "kwargs", ")", ":", "valid_count", "=", "count", "(", "value", ",", "axis", "=", "axis", ")", "value", "=", "fillna", "(", "value", ...
In house nanargmin, nanargmax for object arrays. Always return integer type
[ "In", "house", "nanargmin", "nanargmax", "for", "object", "arrays", ".", "Always", "return", "integer", "type" ]
6d93a95d05bdbfc33fff24064f67d29dd891ab58
https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/nanops.py#L46-L58
train
In house nanargmin nanargmax for object arrays. Always return integer type.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...