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/coding/cftime_offsets.py | _adjust_n_years | def _adjust_n_years(other, n, month, reference_day):
"""Adjust the number of times an annual offset is applied based on
another date, and the reference day provided"""
if n > 0:
if other.month < month or (other.month == month and
other.day < reference_day):
... | python | def _adjust_n_years(other, n, month, reference_day):
"""Adjust the number of times an annual offset is applied based on
another date, and the reference day provided"""
if n > 0:
if other.month < month or (other.month == month and
other.day < reference_day):
... | [
"def",
"_adjust_n_years",
"(",
"other",
",",
"n",
",",
"month",
",",
"reference_day",
")",
":",
"if",
"n",
">",
"0",
":",
"if",
"other",
".",
"month",
"<",
"month",
"or",
"(",
"other",
".",
"month",
"==",
"month",
"and",
"other",
".",
"day",
"<",
... | Adjust the number of times an annual offset is applied based on
another date, and the reference day provided | [
"Adjust",
"the",
"number",
"of",
"times",
"an",
"annual",
"offset",
"is",
"applied",
"based",
"on",
"another",
"date",
"and",
"the",
"reference",
"day",
"provided"
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/coding/cftime_offsets.py#L215-L226 | train | Adjust the number of times an annual offset is applied based on another date and the reference day provided | 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/cftime_offsets.py | _shift_month | def _shift_month(date, months, day_option='start'):
"""Shift the date to a month start or end a given number of months away.
"""
delta_year = (date.month + months) // 12
month = (date.month + months) % 12
if month == 0:
month = 12
delta_year = delta_year - 1
year = date.year + d... | python | def _shift_month(date, months, day_option='start'):
"""Shift the date to a month start or end a given number of months away.
"""
delta_year = (date.month + months) // 12
month = (date.month + months) % 12
if month == 0:
month = 12
delta_year = delta_year - 1
year = date.year + d... | [
"def",
"_shift_month",
"(",
"date",
",",
"months",
",",
"day_option",
"=",
"'start'",
")",
":",
"delta_year",
"=",
"(",
"date",
".",
"month",
"+",
"months",
")",
"//",
"12",
"month",
"=",
"(",
"date",
".",
"month",
"+",
"months",
")",
"%",
"12",
"i... | Shift the date to a month start or end a given number of months away. | [
"Shift",
"the",
"date",
"to",
"a",
"month",
"start",
"or",
"end",
"a",
"given",
"number",
"of",
"months",
"away",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/coding/cftime_offsets.py#L229-L251 | train | Shift the date to a given number of months away. | 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/cftime_offsets.py | roll_qtrday | def roll_qtrday(other, n, month, day_option, modby=3):
"""Possibly increment or decrement the number of periods to shift
based on rollforward/rollbackward conventions.
Parameters
----------
other : cftime.datetime
n : number of periods to increment, before adjusting for rolling
month : int ... | python | def roll_qtrday(other, n, month, day_option, modby=3):
"""Possibly increment or decrement the number of periods to shift
based on rollforward/rollbackward conventions.
Parameters
----------
other : cftime.datetime
n : number of periods to increment, before adjusting for rolling
month : int ... | [
"def",
"roll_qtrday",
"(",
"other",
",",
"n",
",",
"month",
",",
"day_option",
",",
"modby",
"=",
"3",
")",
":",
"months_since",
"=",
"other",
".",
"month",
"%",
"modby",
"-",
"month",
"%",
"modby",
"if",
"n",
">",
"0",
":",
"if",
"months_since",
"... | Possibly increment or decrement the number of periods to shift
based on rollforward/rollbackward conventions.
Parameters
----------
other : cftime.datetime
n : number of periods to increment, before adjusting for rolling
month : int reference month giving the first month of the year
day_opt... | [
"Possibly",
"increment",
"or",
"decrement",
"the",
"number",
"of",
"periods",
"to",
"shift",
"based",
"on",
"rollforward",
"/",
"rollbackward",
"conventions",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/coding/cftime_offsets.py#L254-L292 | train | Roll the number of periods to a given day in a given month. | 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/cftime_offsets.py | to_offset | def to_offset(freq):
"""Convert a frequency string to the appropriate subclass of
BaseCFTimeOffset."""
if isinstance(freq, BaseCFTimeOffset):
return freq
else:
try:
freq_data = re.match(_PATTERN, freq).groupdict()
except AttributeError:
raise ValueError('I... | python | def to_offset(freq):
"""Convert a frequency string to the appropriate subclass of
BaseCFTimeOffset."""
if isinstance(freq, BaseCFTimeOffset):
return freq
else:
try:
freq_data = re.match(_PATTERN, freq).groupdict()
except AttributeError:
raise ValueError('I... | [
"def",
"to_offset",
"(",
"freq",
")",
":",
"if",
"isinstance",
"(",
"freq",
",",
"BaseCFTimeOffset",
")",
":",
"return",
"freq",
"else",
":",
"try",
":",
"freq_data",
"=",
"re",
".",
"match",
"(",
"_PATTERN",
",",
"freq",
")",
".",
"groupdict",
"(",
... | Convert a frequency string to the appropriate subclass of
BaseCFTimeOffset. | [
"Convert",
"a",
"frequency",
"string",
"to",
"the",
"appropriate",
"subclass",
"of",
"BaseCFTimeOffset",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/coding/cftime_offsets.py#L653-L671 | train | Convert a frequency string to the appropriate subclass of BaseCFTimeOffset. | 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/cftime_offsets.py | _generate_linear_range | def _generate_linear_range(start, end, periods):
"""Generate an equally-spaced sequence of cftime.datetime objects between
and including two dates (whose length equals the number of periods)."""
import cftime
total_seconds = (end - start).total_seconds()
values = np.linspace(0., total_seconds, peri... | python | def _generate_linear_range(start, end, periods):
"""Generate an equally-spaced sequence of cftime.datetime objects between
and including two dates (whose length equals the number of periods)."""
import cftime
total_seconds = (end - start).total_seconds()
values = np.linspace(0., total_seconds, peri... | [
"def",
"_generate_linear_range",
"(",
"start",
",",
"end",
",",
"periods",
")",
":",
"import",
"cftime",
"total_seconds",
"=",
"(",
"end",
"-",
"start",
")",
".",
"total_seconds",
"(",
")",
"values",
"=",
"np",
".",
"linspace",
"(",
"0.",
",",
"total_sec... | Generate an equally-spaced sequence of cftime.datetime objects between
and including two dates (whose length equals the number of periods). | [
"Generate",
"an",
"equally",
"-",
"spaced",
"sequence",
"of",
"cftime",
".",
"datetime",
"objects",
"between",
"and",
"including",
"two",
"dates",
"(",
"whose",
"length",
"equals",
"the",
"number",
"of",
"periods",
")",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/coding/cftime_offsets.py#L706-L716 | train | Generate an equally - spaced sequence of cftime. datetime objects between start and end. | 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/cftime_offsets.py | _generate_range | def _generate_range(start, end, periods, offset):
"""Generate a regular range of cftime.datetime objects with a
given time offset.
Adapted from pandas.tseries.offsets.generate_range.
Parameters
----------
start : cftime.datetime, or None
Start of range
end : cftime.datetime, or Non... | python | def _generate_range(start, end, periods, offset):
"""Generate a regular range of cftime.datetime objects with a
given time offset.
Adapted from pandas.tseries.offsets.generate_range.
Parameters
----------
start : cftime.datetime, or None
Start of range
end : cftime.datetime, or Non... | [
"def",
"_generate_range",
"(",
"start",
",",
"end",
",",
"periods",
",",
"offset",
")",
":",
"if",
"start",
":",
"start",
"=",
"offset",
".",
"rollforward",
"(",
"start",
")",
"if",
"end",
":",
"end",
"=",
"offset",
".",
"rollback",
"(",
"end",
")",
... | Generate a regular range of cftime.datetime objects with a
given time offset.
Adapted from pandas.tseries.offsets.generate_range.
Parameters
----------
start : cftime.datetime, or None
Start of range
end : cftime.datetime, or None
End of range
periods : int, or None
... | [
"Generate",
"a",
"regular",
"range",
"of",
"cftime",
".",
"datetime",
"objects",
"with",
"a",
"given",
"time",
"offset",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/coding/cftime_offsets.py#L719-L774 | train | Generate a regular range of cftime. datetime objects with a specific time offset. | 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/cftime_offsets.py | cftime_range | def cftime_range(start=None, end=None, periods=None, freq='D',
normalize=False, name=None, closed=None,
calendar='standard'):
"""Return a fixed frequency CFTimeIndex.
Parameters
----------
start : str or cftime.datetime, optional
Left bound for generating dates... | python | def cftime_range(start=None, end=None, periods=None, freq='D',
normalize=False, name=None, closed=None,
calendar='standard'):
"""Return a fixed frequency CFTimeIndex.
Parameters
----------
start : str or cftime.datetime, optional
Left bound for generating dates... | [
"def",
"cftime_range",
"(",
"start",
"=",
"None",
",",
"end",
"=",
"None",
",",
"periods",
"=",
"None",
",",
"freq",
"=",
"'D'",
",",
"normalize",
"=",
"False",
",",
"name",
"=",
"None",
",",
"closed",
"=",
"None",
",",
"calendar",
"=",
"'standard'",... | Return a fixed frequency CFTimeIndex.
Parameters
----------
start : str or cftime.datetime, optional
Left bound for generating dates.
end : str or cftime.datetime, optional
Right bound for generating dates.
periods : integer, optional
Number of periods to generate.
freq ... | [
"Return",
"a",
"fixed",
"frequency",
"CFTimeIndex",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/coding/cftime_offsets.py#L782-L991 | train | Return a fixed frequency CFTimeIndex for the given start and end dates. | 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/cftime_offsets.py | QuarterOffset.onOffset | def onOffset(self, date):
"""Check if the given date is in the set of possible dates created
using a length-one version of this offset class."""
mod_month = (date.month - self.month) % 3
return mod_month == 0 and date.day == self._get_offset_day(date) | python | def onOffset(self, date):
"""Check if the given date is in the set of possible dates created
using a length-one version of this offset class."""
mod_month = (date.month - self.month) % 3
return mod_month == 0 and date.day == self._get_offset_day(date) | [
"def",
"onOffset",
"(",
"self",
",",
"date",
")",
":",
"mod_month",
"=",
"(",
"date",
".",
"month",
"-",
"self",
".",
"month",
")",
"%",
"3",
"return",
"mod_month",
"==",
"0",
"and",
"date",
".",
"day",
"==",
"self",
".",
"_get_offset_day",
"(",
"d... | Check if the given date is in the set of possible dates created
using a length-one version of this offset class. | [
"Check",
"if",
"the",
"given",
"date",
"is",
"in",
"the",
"set",
"of",
"possible",
"dates",
"created",
"using",
"a",
"length",
"-",
"one",
"version",
"of",
"this",
"offset",
"class",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/coding/cftime_offsets.py#L375-L379 | train | Check if the given date is in the set of possible dates created
using a length - one version of this offset 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/coding/cftime_offsets.py | QuarterBegin.rollforward | def rollforward(self, date):
"""Roll date forward to nearest start of quarter"""
if self.onOffset(date):
return date
else:
return date + QuarterBegin(month=self.month) | python | def rollforward(self, date):
"""Roll date forward to nearest start of quarter"""
if self.onOffset(date):
return date
else:
return date + QuarterBegin(month=self.month) | [
"def",
"rollforward",
"(",
"self",
",",
"date",
")",
":",
"if",
"self",
".",
"onOffset",
"(",
"date",
")",
":",
"return",
"date",
"else",
":",
"return",
"date",
"+",
"QuarterBegin",
"(",
"month",
"=",
"self",
".",
"month",
")"
] | Roll date forward to nearest start of quarter | [
"Roll",
"date",
"forward",
"to",
"nearest",
"start",
"of",
"quarter"
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/coding/cftime_offsets.py#L412-L417 | train | Roll date forward to nearest start of quarter | 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/cftime_offsets.py | QuarterBegin.rollback | def rollback(self, date):
"""Roll date backward to nearest start of quarter"""
if self.onOffset(date):
return date
else:
return date - QuarterBegin(month=self.month) | python | def rollback(self, date):
"""Roll date backward to nearest start of quarter"""
if self.onOffset(date):
return date
else:
return date - QuarterBegin(month=self.month) | [
"def",
"rollback",
"(",
"self",
",",
"date",
")",
":",
"if",
"self",
".",
"onOffset",
"(",
"date",
")",
":",
"return",
"date",
"else",
":",
"return",
"date",
"-",
"QuarterBegin",
"(",
"month",
"=",
"self",
".",
"month",
")"
] | Roll date backward to nearest start of quarter | [
"Roll",
"date",
"backward",
"to",
"nearest",
"start",
"of",
"quarter"
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/coding/cftime_offsets.py#L419-L424 | train | Roll date backward to nearest start of quarter | 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/cftime_offsets.py | QuarterEnd.rollforward | def rollforward(self, date):
"""Roll date forward to nearest end of quarter"""
if self.onOffset(date):
return date
else:
return date + QuarterEnd(month=self.month) | python | def rollforward(self, date):
"""Roll date forward to nearest end of quarter"""
if self.onOffset(date):
return date
else:
return date + QuarterEnd(month=self.month) | [
"def",
"rollforward",
"(",
"self",
",",
"date",
")",
":",
"if",
"self",
".",
"onOffset",
"(",
"date",
")",
":",
"return",
"date",
"else",
":",
"return",
"date",
"+",
"QuarterEnd",
"(",
"month",
"=",
"self",
".",
"month",
")"
] | Roll date forward to nearest end of quarter | [
"Roll",
"date",
"forward",
"to",
"nearest",
"end",
"of",
"quarter"
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/coding/cftime_offsets.py#L437-L442 | train | Roll date forward to nearest end of quarter | 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/cftime_offsets.py | QuarterEnd.rollback | def rollback(self, date):
"""Roll date backward to nearest end of quarter"""
if self.onOffset(date):
return date
else:
return date - QuarterEnd(month=self.month) | python | def rollback(self, date):
"""Roll date backward to nearest end of quarter"""
if self.onOffset(date):
return date
else:
return date - QuarterEnd(month=self.month) | [
"def",
"rollback",
"(",
"self",
",",
"date",
")",
":",
"if",
"self",
".",
"onOffset",
"(",
"date",
")",
":",
"return",
"date",
"else",
":",
"return",
"date",
"-",
"QuarterEnd",
"(",
"month",
"=",
"self",
".",
"month",
")"
] | Roll date backward to nearest end of quarter | [
"Roll",
"date",
"backward",
"to",
"nearest",
"end",
"of",
"quarter"
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/coding/cftime_offsets.py#L444-L449 | train | Roll date backward to nearest end of quarter | 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/cftime_offsets.py | YearBegin.rollforward | def rollforward(self, date):
"""Roll date forward to nearest start of year"""
if self.onOffset(date):
return date
else:
return date + YearBegin(month=self.month) | python | def rollforward(self, date):
"""Roll date forward to nearest start of year"""
if self.onOffset(date):
return date
else:
return date + YearBegin(month=self.month) | [
"def",
"rollforward",
"(",
"self",
",",
"date",
")",
":",
"if",
"self",
".",
"onOffset",
"(",
"date",
")",
":",
"return",
"date",
"else",
":",
"return",
"date",
"+",
"YearBegin",
"(",
"month",
"=",
"self",
".",
"month",
")"
] | Roll date forward to nearest start of year | [
"Roll",
"date",
"forward",
"to",
"nearest",
"start",
"of",
"year"
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/coding/cftime_offsets.py#L498-L503 | train | Roll date forward to nearest start of year | 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/cftime_offsets.py | YearBegin.rollback | def rollback(self, date):
"""Roll date backward to nearest start of year"""
if self.onOffset(date):
return date
else:
return date - YearBegin(month=self.month) | python | def rollback(self, date):
"""Roll date backward to nearest start of year"""
if self.onOffset(date):
return date
else:
return date - YearBegin(month=self.month) | [
"def",
"rollback",
"(",
"self",
",",
"date",
")",
":",
"if",
"self",
".",
"onOffset",
"(",
"date",
")",
":",
"return",
"date",
"else",
":",
"return",
"date",
"-",
"YearBegin",
"(",
"month",
"=",
"self",
".",
"month",
")"
] | Roll date backward to nearest start of year | [
"Roll",
"date",
"backward",
"to",
"nearest",
"start",
"of",
"year"
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/coding/cftime_offsets.py#L505-L510 | train | Roll date backward to nearest start of year | 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/cftime_offsets.py | YearEnd.onOffset | def onOffset(self, date):
"""Check if the given date is in the set of possible dates created
using a length-one version of this offset class."""
return date.day == _days_in_month(date) and date.month == self.month | python | def onOffset(self, date):
"""Check if the given date is in the set of possible dates created
using a length-one version of this offset class."""
return date.day == _days_in_month(date) and date.month == self.month | [
"def",
"onOffset",
"(",
"self",
",",
"date",
")",
":",
"return",
"date",
".",
"day",
"==",
"_days_in_month",
"(",
"date",
")",
"and",
"date",
".",
"month",
"==",
"self",
".",
"month"
] | Check if the given date is in the set of possible dates created
using a length-one version of this offset class. | [
"Check",
"if",
"the",
"given",
"date",
"is",
"in",
"the",
"set",
"of",
"possible",
"dates",
"created",
"using",
"a",
"length",
"-",
"one",
"version",
"of",
"this",
"offset",
"class",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/coding/cftime_offsets.py#L518-L521 | train | Check if the given date is in the set of possible dates created
using a length - one version of this offset 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/coding/cftime_offsets.py | YearEnd.rollforward | def rollforward(self, date):
"""Roll date forward to nearest end of year"""
if self.onOffset(date):
return date
else:
return date + YearEnd(month=self.month) | python | def rollforward(self, date):
"""Roll date forward to nearest end of year"""
if self.onOffset(date):
return date
else:
return date + YearEnd(month=self.month) | [
"def",
"rollforward",
"(",
"self",
",",
"date",
")",
":",
"if",
"self",
".",
"onOffset",
"(",
"date",
")",
":",
"return",
"date",
"else",
":",
"return",
"date",
"+",
"YearEnd",
"(",
"month",
"=",
"self",
".",
"month",
")"
] | Roll date forward to nearest end of year | [
"Roll",
"date",
"forward",
"to",
"nearest",
"end",
"of",
"year"
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/coding/cftime_offsets.py#L523-L528 | train | Roll date forward to nearest end of year | 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/cftime_offsets.py | YearEnd.rollback | def rollback(self, date):
"""Roll date backward to nearest end of year"""
if self.onOffset(date):
return date
else:
return date - YearEnd(month=self.month) | python | def rollback(self, date):
"""Roll date backward to nearest end of year"""
if self.onOffset(date):
return date
else:
return date - YearEnd(month=self.month) | [
"def",
"rollback",
"(",
"self",
",",
"date",
")",
":",
"if",
"self",
".",
"onOffset",
"(",
"date",
")",
":",
"return",
"date",
"else",
":",
"return",
"date",
"-",
"YearEnd",
"(",
"month",
"=",
"self",
".",
"month",
")"
] | Roll date backward to nearest end of year | [
"Roll",
"date",
"backward",
"to",
"nearest",
"end",
"of",
"year"
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/coding/cftime_offsets.py#L530-L535 | train | Roll date backward to nearest end of year | 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/formatting.py | pretty_print | def pretty_print(x, numchars):
"""Given an object `x`, call `str(x)` and format the returned string so
that it is numchars long, padding with trailing spaces or truncating with
ellipses as necessary
"""
s = maybe_truncate(x, numchars)
return s + ' ' * max(numchars - len(s), 0) | python | def pretty_print(x, numchars):
"""Given an object `x`, call `str(x)` and format the returned string so
that it is numchars long, padding with trailing spaces or truncating with
ellipses as necessary
"""
s = maybe_truncate(x, numchars)
return s + ' ' * max(numchars - len(s), 0) | [
"def",
"pretty_print",
"(",
"x",
",",
"numchars",
")",
":",
"s",
"=",
"maybe_truncate",
"(",
"x",
",",
"numchars",
")",
"return",
"s",
"+",
"' '",
"*",
"max",
"(",
"numchars",
"-",
"len",
"(",
"s",
")",
",",
"0",
")"
] | Given an object `x`, call `str(x)` and format the returned string so
that it is numchars long, padding with trailing spaces or truncating with
ellipses as necessary | [
"Given",
"an",
"object",
"x",
"call",
"str",
"(",
"x",
")",
"and",
"format",
"the",
"returned",
"string",
"so",
"that",
"it",
"is",
"numchars",
"long",
"padding",
"with",
"trailing",
"spaces",
"or",
"truncating",
"with",
"ellipses",
"as",
"necessary"
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/formatting.py#L22-L28 | train | Given an object x and numchars long format it so
that it is numchars long and truncate it with trailing spaces as necessary. | 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/formatting.py | first_n_items | def first_n_items(array, n_desired):
"""Returns the first n_desired items of an array"""
# Unfortunately, we can't just do array.flat[:n_desired] here because it
# might not be a numpy.ndarray. Moreover, access to elements of the array
# could be very expensive (e.g. if it's only available over DAP), so... | python | def first_n_items(array, n_desired):
"""Returns the first n_desired items of an array"""
# Unfortunately, we can't just do array.flat[:n_desired] here because it
# might not be a numpy.ndarray. Moreover, access to elements of the array
# could be very expensive (e.g. if it's only available over DAP), so... | [
"def",
"first_n_items",
"(",
"array",
",",
"n_desired",
")",
":",
"# Unfortunately, we can't just do array.flat[:n_desired] here because it",
"# might not be a numpy.ndarray. Moreover, access to elements of the array",
"# could be very expensive (e.g. if it's only available over DAP), so go out"... | Returns the first n_desired items of an array | [
"Returns",
"the",
"first",
"n_desired",
"items",
"of",
"an",
"array"
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/formatting.py#L56-L73 | train | Returns the first n_desired items 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/formatting.py | last_n_items | def last_n_items(array, n_desired):
"""Returns the last n_desired items of an array"""
# Unfortunately, we can't just do array.flat[-n_desired:] here because it
# might not be a numpy.ndarray. Moreover, access to elements of the array
# could be very expensive (e.g. if it's only available over DAP), so ... | python | def last_n_items(array, n_desired):
"""Returns the last n_desired items of an array"""
# Unfortunately, we can't just do array.flat[-n_desired:] here because it
# might not be a numpy.ndarray. Moreover, access to elements of the array
# could be very expensive (e.g. if it's only available over DAP), so ... | [
"def",
"last_n_items",
"(",
"array",
",",
"n_desired",
")",
":",
"# Unfortunately, we can't just do array.flat[-n_desired:] here because it",
"# might not be a numpy.ndarray. Moreover, access to elements of the array",
"# could be very expensive (e.g. if it's only available over DAP), so go out"... | Returns the last n_desired items of an array | [
"Returns",
"the",
"last",
"n_desired",
"items",
"of",
"an",
"array"
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/formatting.py#L76-L89 | train | Returns the last n_desired items 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/formatting.py | last_item | def last_item(array):
"""Returns the last item of an array in a list or an empty list."""
if array.size == 0:
# work around for https://github.com/numpy/numpy/issues/5195
return []
indexer = (slice(-1, None),) * array.ndim
return np.ravel(array[indexer]).tolist() | python | def last_item(array):
"""Returns the last item of an array in a list or an empty list."""
if array.size == 0:
# work around for https://github.com/numpy/numpy/issues/5195
return []
indexer = (slice(-1, None),) * array.ndim
return np.ravel(array[indexer]).tolist() | [
"def",
"last_item",
"(",
"array",
")",
":",
"if",
"array",
".",
"size",
"==",
"0",
":",
"# work around for https://github.com/numpy/numpy/issues/5195",
"return",
"[",
"]",
"indexer",
"=",
"(",
"slice",
"(",
"-",
"1",
",",
"None",
")",
",",
")",
"*",
"array... | Returns the last item of an array in a list or an empty list. | [
"Returns",
"the",
"last",
"item",
"of",
"an",
"array",
"in",
"a",
"list",
"or",
"an",
"empty",
"list",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/formatting.py#L92-L99 | train | Returns the last item of an array in a list or an empty 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/formatting.py | format_timestamp | def format_timestamp(t):
"""Cast given object to a Timestamp and return a nicely formatted string"""
# Timestamp is only valid for 1678 to 2262
try:
datetime_str = str(pd.Timestamp(t))
except OutOfBoundsDatetime:
datetime_str = str(t)
try:
date_str, time_str = datetime_str.s... | python | def format_timestamp(t):
"""Cast given object to a Timestamp and return a nicely formatted string"""
# Timestamp is only valid for 1678 to 2262
try:
datetime_str = str(pd.Timestamp(t))
except OutOfBoundsDatetime:
datetime_str = str(t)
try:
date_str, time_str = datetime_str.s... | [
"def",
"format_timestamp",
"(",
"t",
")",
":",
"# Timestamp is only valid for 1678 to 2262",
"try",
":",
"datetime_str",
"=",
"str",
"(",
"pd",
".",
"Timestamp",
"(",
"t",
")",
")",
"except",
"OutOfBoundsDatetime",
":",
"datetime_str",
"=",
"str",
"(",
"t",
")... | Cast given object to a Timestamp and return a nicely formatted string | [
"Cast",
"given",
"object",
"to",
"a",
"Timestamp",
"and",
"return",
"a",
"nicely",
"formatted",
"string"
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/formatting.py#L102-L119 | train | Cast given object to a Timestamp and return a nicely formatted string | 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/formatting.py | format_timedelta | def format_timedelta(t, timedelta_format=None):
"""Cast given object to a Timestamp and return a nicely formatted string"""
timedelta_str = str(pd.Timedelta(t))
try:
days_str, time_str = timedelta_str.split(' days ')
except ValueError:
# catch NaT and others that don't split nicely
... | python | def format_timedelta(t, timedelta_format=None):
"""Cast given object to a Timestamp and return a nicely formatted string"""
timedelta_str = str(pd.Timedelta(t))
try:
days_str, time_str = timedelta_str.split(' days ')
except ValueError:
# catch NaT and others that don't split nicely
... | [
"def",
"format_timedelta",
"(",
"t",
",",
"timedelta_format",
"=",
"None",
")",
":",
"timedelta_str",
"=",
"str",
"(",
"pd",
".",
"Timedelta",
"(",
"t",
")",
")",
"try",
":",
"days_str",
",",
"time_str",
"=",
"timedelta_str",
".",
"split",
"(",
"' days '... | Cast given object to a Timestamp and return a nicely formatted string | [
"Cast",
"given",
"object",
"to",
"a",
"Timestamp",
"and",
"return",
"a",
"nicely",
"formatted",
"string"
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/formatting.py#L122-L136 | train | Cast given object to a Timestamp and return a nicely formatted string | 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/formatting.py | format_item | def format_item(x, timedelta_format=None, quote_strings=True):
"""Returns a succinct summary of an object as a string"""
if isinstance(x, (np.datetime64, datetime)):
return format_timestamp(x)
if isinstance(x, (np.timedelta64, timedelta)):
return format_timedelta(x, timedelta_format=timedelt... | python | def format_item(x, timedelta_format=None, quote_strings=True):
"""Returns a succinct summary of an object as a string"""
if isinstance(x, (np.datetime64, datetime)):
return format_timestamp(x)
if isinstance(x, (np.timedelta64, timedelta)):
return format_timedelta(x, timedelta_format=timedelt... | [
"def",
"format_item",
"(",
"x",
",",
"timedelta_format",
"=",
"None",
",",
"quote_strings",
"=",
"True",
")",
":",
"if",
"isinstance",
"(",
"x",
",",
"(",
"np",
".",
"datetime64",
",",
"datetime",
")",
")",
":",
"return",
"format_timestamp",
"(",
"x",
... | Returns a succinct summary of an object as a string | [
"Returns",
"a",
"succinct",
"summary",
"of",
"an",
"object",
"as",
"a",
"string"
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/formatting.py#L139-L150 | train | Returns a succinct summary of an object as a string | 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/formatting.py | format_items | def format_items(x):
"""Returns a succinct summaries of all items in a sequence as strings"""
x = np.asarray(x)
timedelta_format = 'datetime'
if np.issubdtype(x.dtype, np.timedelta64):
x = np.asarray(x, dtype='timedelta64[ns]')
day_part = (x[~pd.isnull(x)]
.astype('ti... | python | def format_items(x):
"""Returns a succinct summaries of all items in a sequence as strings"""
x = np.asarray(x)
timedelta_format = 'datetime'
if np.issubdtype(x.dtype, np.timedelta64):
x = np.asarray(x, dtype='timedelta64[ns]')
day_part = (x[~pd.isnull(x)]
.astype('ti... | [
"def",
"format_items",
"(",
"x",
")",
":",
"x",
"=",
"np",
".",
"asarray",
"(",
"x",
")",
"timedelta_format",
"=",
"'datetime'",
"if",
"np",
".",
"issubdtype",
"(",
"x",
".",
"dtype",
",",
"np",
".",
"timedelta64",
")",
":",
"x",
"=",
"np",
".",
... | Returns a succinct summaries of all items in a sequence as strings | [
"Returns",
"a",
"succinct",
"summaries",
"of",
"all",
"items",
"in",
"a",
"sequence",
"as",
"strings"
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/formatting.py#L153-L170 | train | Returns a succinct summaries of all items in a sequence as strings | 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/formatting.py | format_array_flat | def format_array_flat(array, max_width):
"""Return a formatted string for as many items in the flattened version of
array that will fit within max_width characters.
"""
# every item will take up at least two characters, but we always want to
# print at least first and last items
max_possibly_rel... | python | def format_array_flat(array, max_width):
"""Return a formatted string for as many items in the flattened version of
array that will fit within max_width characters.
"""
# every item will take up at least two characters, but we always want to
# print at least first and last items
max_possibly_rel... | [
"def",
"format_array_flat",
"(",
"array",
",",
"max_width",
")",
":",
"# every item will take up at least two characters, but we always want to",
"# print at least first and last items",
"max_possibly_relevant",
"=",
"min",
"(",
"max",
"(",
"array",
".",
"size",
",",
"1",
"... | Return a formatted string for as many items in the flattened version of
array that will fit within max_width characters. | [
"Return",
"a",
"formatted",
"string",
"for",
"as",
"many",
"items",
"in",
"the",
"flattened",
"version",
"of",
"array",
"that",
"will",
"fit",
"within",
"max_width",
"characters",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/formatting.py#L173-L208 | train | Return a string for as many items in the flattened version of the array that will fit within max_width characters. | 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/formatting.py | summarize_attr | def summarize_attr(key, value, col_width=None):
"""Summary for __repr__ - use ``X.attrs[key]`` for full value."""
# Indent key and add ':', then right-pad if col_width is not None
k_str = ' {}:'.format(key)
if col_width is not None:
k_str = pretty_print(k_str, col_width)
# Replace tabs an... | python | def summarize_attr(key, value, col_width=None):
"""Summary for __repr__ - use ``X.attrs[key]`` for full value."""
# Indent key and add ':', then right-pad if col_width is not None
k_str = ' {}:'.format(key)
if col_width is not None:
k_str = pretty_print(k_str, col_width)
# Replace tabs an... | [
"def",
"summarize_attr",
"(",
"key",
",",
"value",
",",
"col_width",
"=",
"None",
")",
":",
"# Indent key and add ':', then right-pad if col_width is not None",
"k_str",
"=",
"' {}:'",
".",
"format",
"(",
"key",
")",
"if",
"col_width",
"is",
"not",
"None",
":",... | Summary for __repr__ - use ``X.attrs[key]`` for full value. | [
"Summary",
"for",
"__repr__",
"-",
"use",
"X",
".",
"attrs",
"[",
"key",
"]",
"for",
"full",
"value",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/formatting.py#L265-L275 | train | Summary for __repr__ - use X. attrs [ key ] for full 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/formatting.py | _get_col_items | def _get_col_items(mapping):
"""Get all column items to format, including both keys of `mapping`
and MultiIndex levels if any.
"""
from .variable import IndexVariable
col_items = []
for k, v in mapping.items():
col_items.append(k)
var = getattr(v, 'variable', v)
if isins... | python | def _get_col_items(mapping):
"""Get all column items to format, including both keys of `mapping`
and MultiIndex levels if any.
"""
from .variable import IndexVariable
col_items = []
for k, v in mapping.items():
col_items.append(k)
var = getattr(v, 'variable', v)
if isins... | [
"def",
"_get_col_items",
"(",
"mapping",
")",
":",
"from",
".",
"variable",
"import",
"IndexVariable",
"col_items",
"=",
"[",
"]",
"for",
"k",
",",
"v",
"in",
"mapping",
".",
"items",
"(",
")",
":",
"col_items",
".",
"append",
"(",
"k",
")",
"var",
"... | Get all column items to format, including both keys of `mapping`
and MultiIndex levels if any. | [
"Get",
"all",
"column",
"items",
"to",
"format",
"including",
"both",
"keys",
"of",
"mapping",
"and",
"MultiIndex",
"levels",
"if",
"any",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/formatting.py#L281-L295 | train | Get all column items to format including both keys of mapping and MultiIndex levels if any. | 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/formatting.py | short_dask_repr | def short_dask_repr(array, show_dtype=True):
"""Similar to dask.array.DataArray.__repr__, but without
redundant information that's already printed by the repr
function of the xarray wrapper.
"""
chunksize = tuple(c[0] for c in array.chunks)
if show_dtype:
return 'dask.array<shape={}, dty... | python | def short_dask_repr(array, show_dtype=True):
"""Similar to dask.array.DataArray.__repr__, but without
redundant information that's already printed by the repr
function of the xarray wrapper.
"""
chunksize = tuple(c[0] for c in array.chunks)
if show_dtype:
return 'dask.array<shape={}, dty... | [
"def",
"short_dask_repr",
"(",
"array",
",",
"show_dtype",
"=",
"True",
")",
":",
"chunksize",
"=",
"tuple",
"(",
"c",
"[",
"0",
"]",
"for",
"c",
"in",
"array",
".",
"chunks",
")",
"if",
"show_dtype",
":",
"return",
"'dask.array<shape={}, dtype={}, chunksize... | Similar to dask.array.DataArray.__repr__, but without
redundant information that's already printed by the repr
function of the xarray wrapper. | [
"Similar",
"to",
"dask",
".",
"array",
".",
"DataArray",
".",
"__repr__",
"but",
"without",
"redundant",
"information",
"that",
"s",
"already",
"printed",
"by",
"the",
"repr",
"function",
"of",
"the",
"xarray",
"wrapper",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/formatting.py#L380-L391 | train | Similar to dask. array. DataArray. __repr__ but without
redundant information that s already printed by the repr
function of the xarray wrapper. | 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.py | Resample._upsample | def _upsample(self, method, *args, **kwargs):
"""Dispatch function to call appropriate up-sampling methods on
data.
This method should not be called directly; instead, use one of the
wrapper functions supplied by `Resample`.
Parameters
----------
method : str {'... | python | def _upsample(self, method, *args, **kwargs):
"""Dispatch function to call appropriate up-sampling methods on
data.
This method should not be called directly; instead, use one of the
wrapper functions supplied by `Resample`.
Parameters
----------
method : str {'... | [
"def",
"_upsample",
"(",
"self",
",",
"method",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"upsampled_index",
"=",
"self",
".",
"_full_index",
"# Drop non-dimension coordinates along the resampled dimension",
"for",
"k",
",",
"v",
"in",
"self",
".",
... | Dispatch function to call appropriate up-sampling methods on
data.
This method should not be called directly; instead, use one of the
wrapper functions supplied by `Resample`.
Parameters
----------
method : str {'asfreq', 'pad', 'ffill', 'backfill', 'bfill', 'nearest',
... | [
"Dispatch",
"function",
"to",
"call",
"appropriate",
"up",
"-",
"sampling",
"methods",
"on",
"data",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/resample.py#L21-L66 | train | Dispatch function to call appropriate up - sampling methods on the 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/resample.py | Resample._interpolate | def _interpolate(self, kind='linear'):
"""Apply scipy.interpolate.interp1d along resampling dimension."""
# drop any existing non-dimension coordinates along the resampling
# dimension
dummy = self._obj.copy()
for k, v in self._obj.coords.items():
if k != self._dim an... | python | def _interpolate(self, kind='linear'):
"""Apply scipy.interpolate.interp1d along resampling dimension."""
# drop any existing non-dimension coordinates along the resampling
# dimension
dummy = self._obj.copy()
for k, v in self._obj.coords.items():
if k != self._dim an... | [
"def",
"_interpolate",
"(",
"self",
",",
"kind",
"=",
"'linear'",
")",
":",
"# drop any existing non-dimension coordinates along the resampling",
"# dimension",
"dummy",
"=",
"self",
".",
"_obj",
".",
"copy",
"(",
")",
"for",
"k",
",",
"v",
"in",
"self",
".",
... | Apply scipy.interpolate.interp1d along resampling dimension. | [
"Apply",
"scipy",
".",
"interpolate",
".",
"interp1d",
"along",
"resampling",
"dimension",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/resample.py#L139-L149 | train | Apply scipy. interpolate. interp1d along resampling 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/resample.py | DataArrayResample.apply | def apply(self, func, shortcut=False, args=(), **kwargs):
"""Apply a function over each array in the group and concatenate them
together into a new array.
`func` is called like `func(ar, *args, **kwargs)` for each array `ar`
in this group.
Apply uses heuristics (like `pandas.Gr... | python | def apply(self, func, shortcut=False, args=(), **kwargs):
"""Apply a function over each array in the group and concatenate them
together into a new array.
`func` is called like `func(ar, *args, **kwargs)` for each array `ar`
in this group.
Apply uses heuristics (like `pandas.Gr... | [
"def",
"apply",
"(",
"self",
",",
"func",
",",
"shortcut",
"=",
"False",
",",
"args",
"=",
"(",
")",
",",
"*",
"*",
"kwargs",
")",
":",
"combined",
"=",
"super",
"(",
"DataArrayResample",
",",
"self",
")",
".",
"apply",
"(",
"func",
",",
"shortcut"... | Apply a function over each array in the group and concatenate them
together into a new array.
`func` is called like `func(ar, *args, **kwargs)` for each array `ar`
in this group.
Apply uses heuristics (like `pandas.GroupBy.apply`) to figure out how
to stack together the array. ... | [
"Apply",
"a",
"function",
"over",
"each",
"array",
"in",
"the",
"group",
"and",
"concatenate",
"them",
"together",
"into",
"a",
"new",
"array",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/resample.py#L168-L219 | train | Apply a function over each array in the group and concatenate them together into a new 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/resample.py | DatasetResample.apply | def apply(self, func, args=(), **kwargs):
"""Apply a function over each Dataset in the groups generated for
resampling and concatenate them together into a new Dataset.
`func` is called like `func(ds, *args, **kwargs)` for each dataset `ds`
in this group.
Apply uses heuristics... | python | def apply(self, func, args=(), **kwargs):
"""Apply a function over each Dataset in the groups generated for
resampling and concatenate them together into a new Dataset.
`func` is called like `func(ds, *args, **kwargs)` for each dataset `ds`
in this group.
Apply uses heuristics... | [
"def",
"apply",
"(",
"self",
",",
"func",
",",
"args",
"=",
"(",
")",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
".",
"pop",
"(",
"'shortcut'",
",",
"None",
")",
"# ignore shortcut if set (for now)",
"applied",
"=",
"(",
"func",
"(",
"ds",
",",
"*"... | Apply a function over each Dataset in the groups generated for
resampling and concatenate them together into a new Dataset.
`func` is called like `func(ds, *args, **kwargs)` for each dataset `ds`
in this group.
Apply uses heuristics (like `pandas.GroupBy.apply`) to figure out how
... | [
"Apply",
"a",
"function",
"over",
"each",
"Dataset",
"in",
"the",
"groups",
"generated",
"for",
"resampling",
"and",
"concatenate",
"them",
"together",
"into",
"a",
"new",
"Dataset",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/resample.py#L241-L274 | train | Apply a function over each Dataset in the groups generated for
resampling and concatenate them together into a new 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/resample.py | DatasetResample.reduce | def reduce(self, func, dim=None, keep_attrs=None, **kwargs):
"""Reduce the items in this group by applying `func` along the
pre-defined resampling dimension.
Parameters
----------
func : function
Function which can be called in the form
`func(x, axis=axis... | python | def reduce(self, func, dim=None, keep_attrs=None, **kwargs):
"""Reduce the items in this group by applying `func` along the
pre-defined resampling dimension.
Parameters
----------
func : function
Function which can be called in the form
`func(x, axis=axis... | [
"def",
"reduce",
"(",
"self",
",",
"func",
",",
"dim",
"=",
"None",
",",
"keep_attrs",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"dim",
"==",
"DEFAULT_DIMS",
":",
"dim",
"=",
"None",
"return",
"super",
"(",
"DatasetResample",
",",
"self",... | Reduce the items in this group by applying `func` along the
pre-defined resampling dimension.
Parameters
----------
func : function
Function which can be called in the form
`func(x, axis=axis, **kwargs)` to return the result of collapsing
an np.ndarra... | [
"Reduce",
"the",
"items",
"in",
"this",
"group",
"by",
"applying",
"func",
"along",
"the",
"pre",
"-",
"defined",
"resampling",
"dimension",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/resample.py#L276-L305 | train | Reduce the items in this group by applying func along the specified resampling 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/indexes.py | default_indexes | def default_indexes(
coords: Mapping[Any, Variable],
dims: Iterable,
) -> 'OrderedDict[Any, pd.Index]':
"""Default indexes for a Dataset/DataArray.
Parameters
----------
coords : Mapping[Any, xarray.Variable]
Coordinate variables from which to draw default indexes.
dims : iterable
... | python | def default_indexes(
coords: Mapping[Any, Variable],
dims: Iterable,
) -> 'OrderedDict[Any, pd.Index]':
"""Default indexes for a Dataset/DataArray.
Parameters
----------
coords : Mapping[Any, xarray.Variable]
Coordinate variables from which to draw default indexes.
dims : iterable
... | [
"def",
"default_indexes",
"(",
"coords",
":",
"Mapping",
"[",
"Any",
",",
"Variable",
"]",
",",
"dims",
":",
"Iterable",
",",
")",
"->",
"'OrderedDict[Any, pd.Index]'",
":",
"return",
"OrderedDict",
"(",
"(",
"key",
",",
"coords",
"[",
"key",
"]",
".",
"... | Default indexes for a Dataset/DataArray.
Parameters
----------
coords : Mapping[Any, xarray.Variable]
Coordinate variables from which to draw default indexes.
dims : iterable
Iterable of dimension names.
Returns
-------
Mapping from indexing keys (levels/dimension names) to ... | [
"Default",
"indexes",
"for",
"a",
"Dataset",
"/",
"DataArray",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/indexes.py#L39-L58 | train | Returns a default indexes for a Dataset or 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/indexes.py | isel_variable_and_index | def isel_variable_and_index(
name: Hashable,
variable: Variable,
index: pd.Index,
indexers: Mapping[Any, Union[slice, Variable]],
) -> Tuple[Variable, Optional[pd.Index]]:
"""Index a Variable and pandas.Index together."""
if not indexers:
# nothing to index
return variable.copy(d... | python | def isel_variable_and_index(
name: Hashable,
variable: Variable,
index: pd.Index,
indexers: Mapping[Any, Union[slice, Variable]],
) -> Tuple[Variable, Optional[pd.Index]]:
"""Index a Variable and pandas.Index together."""
if not indexers:
# nothing to index
return variable.copy(d... | [
"def",
"isel_variable_and_index",
"(",
"name",
":",
"Hashable",
",",
"variable",
":",
"Variable",
",",
"index",
":",
"pd",
".",
"Index",
",",
"indexers",
":",
"Mapping",
"[",
"Any",
",",
"Union",
"[",
"slice",
",",
"Variable",
"]",
"]",
",",
")",
"->",... | Index a Variable and pandas.Index together. | [
"Index",
"a",
"Variable",
"and",
"pandas",
".",
"Index",
"together",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/indexes.py#L61-L89 | train | Index a Variable and pandas. Index together. | 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/computation.py | build_output_coords | def build_output_coords(
args: list,
signature: _UFuncSignature,
exclude_dims: AbstractSet = frozenset(),
) -> 'List[OrderedDict[Any, Variable]]':
"""Build output coordinates for an operation.
Parameters
----------
args : list
List of raw operation arguments. Any valid types for xar... | python | def build_output_coords(
args: list,
signature: _UFuncSignature,
exclude_dims: AbstractSet = frozenset(),
) -> 'List[OrderedDict[Any, Variable]]':
"""Build output coordinates for an operation.
Parameters
----------
args : list
List of raw operation arguments. Any valid types for xar... | [
"def",
"build_output_coords",
"(",
"args",
":",
"list",
",",
"signature",
":",
"_UFuncSignature",
",",
"exclude_dims",
":",
"AbstractSet",
"=",
"frozenset",
"(",
")",
",",
")",
"->",
"'List[OrderedDict[Any, Variable]]'",
":",
"input_coords",
"=",
"_get_coord_variabl... | Build output coordinates for an operation.
Parameters
----------
args : list
List of raw operation arguments. Any valid types for xarray operations
are OK, e.g., scalars, Variable, DataArray, Dataset.
signature : _UfuncSignature
Core dimensions signature for the operation.
e... | [
"Build",
"output",
"coordinates",
"for",
"an",
"operation",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/computation.py#L145-L191 | train | Builds the output coordinates for an operation. | 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/computation.py | apply_dataarray_vfunc | def apply_dataarray_vfunc(
func,
*args,
signature,
join='inner',
exclude_dims=frozenset(),
keep_attrs=False
):
"""Apply a variable level function over DataArray, Variable and/or ndarray
objects.
"""
from .dataarray import DataArray
if len(args) > 1:
args = deep_align... | python | def apply_dataarray_vfunc(
func,
*args,
signature,
join='inner',
exclude_dims=frozenset(),
keep_attrs=False
):
"""Apply a variable level function over DataArray, Variable and/or ndarray
objects.
"""
from .dataarray import DataArray
if len(args) > 1:
args = deep_align... | [
"def",
"apply_dataarray_vfunc",
"(",
"func",
",",
"*",
"args",
",",
"signature",
",",
"join",
"=",
"'inner'",
",",
"exclude_dims",
"=",
"frozenset",
"(",
")",
",",
"keep_attrs",
"=",
"False",
")",
":",
"from",
".",
"dataarray",
"import",
"DataArray",
"if",... | Apply a variable level function over DataArray, Variable and/or ndarray
objects. | [
"Apply",
"a",
"variable",
"level",
"function",
"over",
"DataArray",
"Variable",
"and",
"/",
"or",
"ndarray",
"objects",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/computation.py#L194-L227 | train | Apply a variable level function over DataArray Variable and ndarray
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/computation.py | apply_dict_of_variables_vfunc | def apply_dict_of_variables_vfunc(
func, *args, signature, join='inner', fill_value=None
):
"""Apply a variable level function over dicts of DataArray, DataArray,
Variable and ndarray objects.
"""
args = [_as_variables_or_variable(arg) for arg in args]
names = join_dict_keys(args, how=join)
... | python | def apply_dict_of_variables_vfunc(
func, *args, signature, join='inner', fill_value=None
):
"""Apply a variable level function over dicts of DataArray, DataArray,
Variable and ndarray objects.
"""
args = [_as_variables_or_variable(arg) for arg in args]
names = join_dict_keys(args, how=join)
... | [
"def",
"apply_dict_of_variables_vfunc",
"(",
"func",
",",
"*",
"args",
",",
"signature",
",",
"join",
"=",
"'inner'",
",",
"fill_value",
"=",
"None",
")",
":",
"args",
"=",
"[",
"_as_variables_or_variable",
"(",
"arg",
")",
"for",
"arg",
"in",
"args",
"]",... | Apply a variable level function over dicts of DataArray, DataArray,
Variable and ndarray objects. | [
"Apply",
"a",
"variable",
"level",
"function",
"over",
"dicts",
"of",
"DataArray",
"DataArray",
"Variable",
"and",
"ndarray",
"objects",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/computation.py#L305-L322 | train | Apply a variable level function over dicts of DataArray Variable and ndarray 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/computation.py | _fast_dataset | def _fast_dataset(
variables: 'OrderedDict[Any, Variable]',
coord_variables: Mapping[Any, Variable],
) -> 'Dataset':
"""Create a dataset as quickly as possible.
Beware: the `variables` OrderedDict is modified INPLACE.
"""
from .dataset import Dataset
variables.update(coord_variables)
co... | python | def _fast_dataset(
variables: 'OrderedDict[Any, Variable]',
coord_variables: Mapping[Any, Variable],
) -> 'Dataset':
"""Create a dataset as quickly as possible.
Beware: the `variables` OrderedDict is modified INPLACE.
"""
from .dataset import Dataset
variables.update(coord_variables)
co... | [
"def",
"_fast_dataset",
"(",
"variables",
":",
"'OrderedDict[Any, Variable]'",
",",
"coord_variables",
":",
"Mapping",
"[",
"Any",
",",
"Variable",
"]",
",",
")",
"->",
"'Dataset'",
":",
"from",
".",
"dataset",
"import",
"Dataset",
"variables",
".",
"update",
... | Create a dataset as quickly as possible.
Beware: the `variables` OrderedDict is modified INPLACE. | [
"Create",
"a",
"dataset",
"as",
"quickly",
"as",
"possible",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/computation.py#L325-L336 | train | Create a Dataset as quickly as possible. | 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/computation.py | apply_dataset_vfunc | def apply_dataset_vfunc(
func,
*args,
signature,
join='inner',
dataset_join='exact',
fill_value=_NO_FILL_VALUE,
exclude_dims=frozenset(),
keep_attrs=False
):
"""Apply a variable level function over Dataset, dict of DataArray,
DataArray, Variable and/or ndarray objects.
"""
... | python | def apply_dataset_vfunc(
func,
*args,
signature,
join='inner',
dataset_join='exact',
fill_value=_NO_FILL_VALUE,
exclude_dims=frozenset(),
keep_attrs=False
):
"""Apply a variable level function over Dataset, dict of DataArray,
DataArray, Variable and/or ndarray objects.
"""
... | [
"def",
"apply_dataset_vfunc",
"(",
"func",
",",
"*",
"args",
",",
"signature",
",",
"join",
"=",
"'inner'",
",",
"dataset_join",
"=",
"'exact'",
",",
"fill_value",
"=",
"_NO_FILL_VALUE",
",",
"exclude_dims",
"=",
"frozenset",
"(",
")",
",",
"keep_attrs",
"="... | Apply a variable level function over Dataset, dict of DataArray,
DataArray, Variable and/or ndarray objects. | [
"Apply",
"a",
"variable",
"level",
"function",
"over",
"Dataset",
"dict",
"of",
"DataArray",
"DataArray",
"Variable",
"and",
"/",
"or",
"ndarray",
"objects",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/computation.py#L339-L384 | train | Apply a variable level function over Dataset dict of DataArray Variable and ndarray 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/computation.py | _iter_over_selections | def _iter_over_selections(obj, dim, values):
"""Iterate over selections of an xarray object in the provided order."""
from .groupby import _dummy_copy
dummy = None
for value in values:
try:
obj_sel = obj.sel(**{dim: value})
except (KeyError, IndexError):
if dummy... | python | def _iter_over_selections(obj, dim, values):
"""Iterate over selections of an xarray object in the provided order."""
from .groupby import _dummy_copy
dummy = None
for value in values:
try:
obj_sel = obj.sel(**{dim: value})
except (KeyError, IndexError):
if dummy... | [
"def",
"_iter_over_selections",
"(",
"obj",
",",
"dim",
",",
"values",
")",
":",
"from",
".",
"groupby",
"import",
"_dummy_copy",
"dummy",
"=",
"None",
"for",
"value",
"in",
"values",
":",
"try",
":",
"obj_sel",
"=",
"obj",
".",
"sel",
"(",
"*",
"*",
... | Iterate over selections of an xarray object in the provided order. | [
"Iterate",
"over",
"selections",
"of",
"an",
"xarray",
"object",
"in",
"the",
"provided",
"order",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/computation.py#L387-L399 | train | Iterate over selections of an xarray object in the provided order. | 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/computation.py | apply_groupby_func | def apply_groupby_func(func, *args):
"""Apply a dataset or datarray level function over GroupBy, Dataset,
DataArray, Variable and/or ndarray objects.
"""
from .groupby import GroupBy, peek_at
from .variable import Variable
groupbys = [arg for arg in args if isinstance(arg, GroupBy)]
assert ... | python | def apply_groupby_func(func, *args):
"""Apply a dataset or datarray level function over GroupBy, Dataset,
DataArray, Variable and/or ndarray objects.
"""
from .groupby import GroupBy, peek_at
from .variable import Variable
groupbys = [arg for arg in args if isinstance(arg, GroupBy)]
assert ... | [
"def",
"apply_groupby_func",
"(",
"func",
",",
"*",
"args",
")",
":",
"from",
".",
"groupby",
"import",
"GroupBy",
",",
"peek_at",
"from",
".",
"variable",
"import",
"Variable",
"groupbys",
"=",
"[",
"arg",
"for",
"arg",
"in",
"args",
"if",
"isinstance",
... | Apply a dataset or datarray level function over GroupBy, Dataset,
DataArray, Variable and/or ndarray objects. | [
"Apply",
"a",
"dataset",
"or",
"datarray",
"level",
"function",
"over",
"GroupBy",
"Dataset",
"DataArray",
"Variable",
"and",
"/",
"or",
"ndarray",
"objects",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/computation.py#L402-L442 | train | Apply a function over a GroupBy Dataset DataArray or ndarray 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/computation.py | apply_variable_ufunc | def apply_variable_ufunc(
func,
*args,
signature,
exclude_dims=frozenset(),
dask='forbidden',
output_dtypes=None,
output_sizes=None,
keep_attrs=False
):
"""Apply a ndarray level function over Variable and/or ndarray objects.
"""
from .variable import Variable, as_compatible_d... | python | def apply_variable_ufunc(
func,
*args,
signature,
exclude_dims=frozenset(),
dask='forbidden',
output_dtypes=None,
output_sizes=None,
keep_attrs=False
):
"""Apply a ndarray level function over Variable and/or ndarray objects.
"""
from .variable import Variable, as_compatible_d... | [
"def",
"apply_variable_ufunc",
"(",
"func",
",",
"*",
"args",
",",
"signature",
",",
"exclude_dims",
"=",
"frozenset",
"(",
")",
",",
"dask",
"=",
"'forbidden'",
",",
"output_dtypes",
"=",
"None",
",",
"output_sizes",
"=",
"None",
",",
"keep_attrs",
"=",
"... | Apply a ndarray level function over Variable and/or ndarray objects. | [
"Apply",
"a",
"ndarray",
"level",
"function",
"over",
"Variable",
"and",
"/",
"or",
"ndarray",
"objects",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/computation.py#L519-L602 | train | Apply a function over a Variable and ndarray 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/computation.py | apply_array_ufunc | def apply_array_ufunc(func, *args, dask='forbidden'):
"""Apply a ndarray level function over ndarray objects."""
if any(isinstance(arg, dask_array_type) for arg in args):
if dask == 'forbidden':
raise ValueError('apply_ufunc encountered a dask array on an '
'argu... | python | def apply_array_ufunc(func, *args, dask='forbidden'):
"""Apply a ndarray level function over ndarray objects."""
if any(isinstance(arg, dask_array_type) for arg in args):
if dask == 'forbidden':
raise ValueError('apply_ufunc encountered a dask array on an '
'argu... | [
"def",
"apply_array_ufunc",
"(",
"func",
",",
"*",
"args",
",",
"dask",
"=",
"'forbidden'",
")",
":",
"if",
"any",
"(",
"isinstance",
"(",
"arg",
",",
"dask_array_type",
")",
"for",
"arg",
"in",
"args",
")",
":",
"if",
"dask",
"==",
"'forbidden'",
":",... | Apply a ndarray level function over ndarray objects. | [
"Apply",
"a",
"ndarray",
"level",
"function",
"over",
"ndarray",
"objects",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/computation.py#L663-L680 | train | Apply a ndarray level function over ndarray 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/computation.py | apply_ufunc | def apply_ufunc(
func: Callable,
*args: Any,
input_core_dims: Optional[Sequence[Sequence]] = None,
output_core_dims: Optional[Sequence[Sequence]] = ((),),
exclude_dims: AbstractSet = frozenset(),
vectorize: bool = False,
join: str = 'exact',
dataset_join: str = 'exact',
dataset_fill_... | python | def apply_ufunc(
func: Callable,
*args: Any,
input_core_dims: Optional[Sequence[Sequence]] = None,
output_core_dims: Optional[Sequence[Sequence]] = ((),),
exclude_dims: AbstractSet = frozenset(),
vectorize: bool = False,
join: str = 'exact',
dataset_join: str = 'exact',
dataset_fill_... | [
"def",
"apply_ufunc",
"(",
"func",
":",
"Callable",
",",
"*",
"args",
":",
"Any",
",",
"input_core_dims",
":",
"Optional",
"[",
"Sequence",
"[",
"Sequence",
"]",
"]",
"=",
"None",
",",
"output_core_dims",
":",
"Optional",
"[",
"Sequence",
"[",
"Sequence",
... | Apply a vectorized function for unlabeled arrays on xarray objects.
The function will be mapped over the data variable(s) of the input
arguments using xarray's standard rules for labeled computation, including
alignment, broadcasting, looping over GroupBy/Dataset variables, and
merging of coordinates.
... | [
"Apply",
"a",
"vectorized",
"function",
"for",
"unlabeled",
"arrays",
"on",
"xarray",
"objects",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/computation.py#L683-L973 | train | Applies a function to unlabeled arrays on 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/computation.py | dot | def dot(*arrays, dims=None, **kwargs):
"""Generalized dot product for xarray objects. Like np.einsum, but
provides a simpler interface based on array dimensions.
Parameters
----------
arrays: DataArray (or Variable) objects
Arrays to compute.
dims: str or tuple of strings, optional
... | python | def dot(*arrays, dims=None, **kwargs):
"""Generalized dot product for xarray objects. Like np.einsum, but
provides a simpler interface based on array dimensions.
Parameters
----------
arrays: DataArray (or Variable) objects
Arrays to compute.
dims: str or tuple of strings, optional
... | [
"def",
"dot",
"(",
"*",
"arrays",
",",
"dims",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"from",
".",
"dataarray",
"import",
"DataArray",
"from",
".",
"variable",
"import",
"Variable",
"if",
"any",
"(",
"not",
"isinstance",
"(",
"arr",
",",
"("... | Generalized dot product for xarray objects. Like np.einsum, but
provides a simpler interface based on array dimensions.
Parameters
----------
arrays: DataArray (or Variable) objects
Arrays to compute.
dims: str or tuple of strings, optional
Which dimensions to sum over.
If n... | [
"Generalized",
"dot",
"product",
"for",
"xarray",
"objects",
".",
"Like",
"np",
".",
"einsum",
"but",
"provides",
"a",
"simpler",
"interface",
"based",
"on",
"array",
"dimensions",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/computation.py#L976-L1075 | train | Generalized dot product for 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/computation.py | where | def where(cond, x, y):
"""Return elements from `x` or `y` depending on `cond`.
Performs xarray-like broadcasting across input arguments.
Parameters
----------
cond : scalar, array, Variable, DataArray or Dataset with boolean dtype
When True, return values from `x`, otherwise returns values... | python | def where(cond, x, y):
"""Return elements from `x` or `y` depending on `cond`.
Performs xarray-like broadcasting across input arguments.
Parameters
----------
cond : scalar, array, Variable, DataArray or Dataset with boolean dtype
When True, return values from `x`, otherwise returns values... | [
"def",
"where",
"(",
"cond",
",",
"x",
",",
"y",
")",
":",
"# alignment for three arguments is complicated, so don't support it yet",
"return",
"apply_ufunc",
"(",
"duck_array_ops",
".",
"where",
",",
"cond",
",",
"x",
",",
"y",
",",
"join",
"=",
"'exact'",
",",... | Return elements from `x` or `y` depending on `cond`.
Performs xarray-like broadcasting across input arguments.
Parameters
----------
cond : scalar, array, Variable, DataArray or Dataset with boolean dtype
When True, return values from `x`, otherwise returns values from `y`.
x, y : scalar, ... | [
"Return",
"elements",
"from",
"x",
"or",
"y",
"depending",
"on",
"cond",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/computation.py#L1078-L1117 | train | Returns elements from x or y depending on cond. | 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/computation.py | _UFuncSignature.to_gufunc_string | def to_gufunc_string(self):
"""Create an equivalent signature string for a NumPy gufunc.
Unlike __str__, handles dimensions that don't map to Python
identifiers.
"""
all_dims = self.all_core_dims
dims_map = dict(zip(sorted(all_dims), range(len(all_dims))))
input_... | python | def to_gufunc_string(self):
"""Create an equivalent signature string for a NumPy gufunc.
Unlike __str__, handles dimensions that don't map to Python
identifiers.
"""
all_dims = self.all_core_dims
dims_map = dict(zip(sorted(all_dims), range(len(all_dims))))
input_... | [
"def",
"to_gufunc_string",
"(",
"self",
")",
":",
"all_dims",
"=",
"self",
".",
"all_core_dims",
"dims_map",
"=",
"dict",
"(",
"zip",
"(",
"sorted",
"(",
"all_dims",
")",
",",
"range",
"(",
"len",
"(",
"all_dims",
")",
")",
")",
")",
"input_core_dims",
... | Create an equivalent signature string for a NumPy gufunc.
Unlike __str__, handles dimensions that don't map to Python
identifiers. | [
"Create",
"an",
"equivalent",
"signature",
"string",
"for",
"a",
"NumPy",
"gufunc",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/computation.py#L104-L117 | train | Create an equivalent signature string for a NumPy gufunc.
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/nputils.py | inverse_permutation | def inverse_permutation(indices):
"""Return indices for an inverse permutation.
Parameters
----------
indices : 1D np.ndarray with dtype=int
Integer positions to assign elements to.
Returns
-------
inverse_permutation : 1D np.ndarray with dtype=int
Integer indices to take f... | python | def inverse_permutation(indices):
"""Return indices for an inverse permutation.
Parameters
----------
indices : 1D np.ndarray with dtype=int
Integer positions to assign elements to.
Returns
-------
inverse_permutation : 1D np.ndarray with dtype=int
Integer indices to take f... | [
"def",
"inverse_permutation",
"(",
"indices",
")",
":",
"# use intp instead of int64 because of windows :(",
"inverse_permutation",
"=",
"np",
".",
"empty",
"(",
"len",
"(",
"indices",
")",
",",
"dtype",
"=",
"np",
".",
"intp",
")",
"inverse_permutation",
"[",
"in... | Return indices for an inverse permutation.
Parameters
----------
indices : 1D np.ndarray with dtype=int
Integer positions to assign elements to.
Returns
-------
inverse_permutation : 1D np.ndarray with dtype=int
Integer indices to take from the original array to create the
... | [
"Return",
"indices",
"for",
"an",
"inverse",
"permutation",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/nputils.py#L44-L61 | train | Return indices for an inverse permutation. | 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/nputils.py | _is_contiguous | def _is_contiguous(positions):
"""Given a non-empty list, does it consist of contiguous integers?"""
previous = positions[0]
for current in positions[1:]:
if current != previous + 1:
return False
previous = current
return True | python | def _is_contiguous(positions):
"""Given a non-empty list, does it consist of contiguous integers?"""
previous = positions[0]
for current in positions[1:]:
if current != previous + 1:
return False
previous = current
return True | [
"def",
"_is_contiguous",
"(",
"positions",
")",
":",
"previous",
"=",
"positions",
"[",
"0",
"]",
"for",
"current",
"in",
"positions",
"[",
"1",
":",
"]",
":",
"if",
"current",
"!=",
"previous",
"+",
"1",
":",
"return",
"False",
"previous",
"=",
"curre... | Given a non-empty list, does it consist of contiguous integers? | [
"Given",
"a",
"non",
"-",
"empty",
"list",
"does",
"it",
"consist",
"of",
"contiguous",
"integers?"
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/nputils.py#L90-L97 | train | Given a non - empty list returns True if all of the elements in the list are contiguous integers. | 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/nputils.py | _advanced_indexer_subspaces | def _advanced_indexer_subspaces(key):
"""Indices of the advanced indexes subspaces for mixed indexing and vindex.
"""
if not isinstance(key, tuple):
key = (key,)
advanced_index_positions = [i for i, k in enumerate(key)
if not isinstance(k, slice)]
if (not adv... | python | def _advanced_indexer_subspaces(key):
"""Indices of the advanced indexes subspaces for mixed indexing and vindex.
"""
if not isinstance(key, tuple):
key = (key,)
advanced_index_positions = [i for i, k in enumerate(key)
if not isinstance(k, slice)]
if (not adv... | [
"def",
"_advanced_indexer_subspaces",
"(",
"key",
")",
":",
"if",
"not",
"isinstance",
"(",
"key",
",",
"tuple",
")",
":",
"key",
"=",
"(",
"key",
",",
")",
"advanced_index_positions",
"=",
"[",
"i",
"for",
"i",
",",
"k",
"in",
"enumerate",
"(",
"key",... | Indices of the advanced indexes subspaces for mixed indexing and vindex. | [
"Indices",
"of",
"the",
"advanced",
"indexes",
"subspaces",
"for",
"mixed",
"indexing",
"and",
"vindex",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/nputils.py#L100-L120 | train | Indices of the advanced indexes subspaces for mixed indexing and vindex. | 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/nputils.py | rolling_window | def rolling_window(a, axis, window, center, fill_value):
""" rolling window with padding. """
pads = [(0, 0) for s in a.shape]
if center:
start = int(window / 2) # 10 -> 5, 9 -> 4
end = window - 1 - start
pads[axis] = (start, end)
else:
pads[axis] = (window - 1, 0)
... | python | def rolling_window(a, axis, window, center, fill_value):
""" rolling window with padding. """
pads = [(0, 0) for s in a.shape]
if center:
start = int(window / 2) # 10 -> 5, 9 -> 4
end = window - 1 - start
pads[axis] = (start, end)
else:
pads[axis] = (window - 1, 0)
... | [
"def",
"rolling_window",
"(",
"a",
",",
"axis",
",",
"window",
",",
"center",
",",
"fill_value",
")",
":",
"pads",
"=",
"[",
"(",
"0",
",",
"0",
")",
"for",
"s",
"in",
"a",
".",
"shape",
"]",
"if",
"center",
":",
"start",
"=",
"int",
"(",
"wind... | rolling window with padding. | [
"rolling",
"window",
"with",
"padding",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/nputils.py#L144-L154 | train | rolling window with padding. | 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/nputils.py | _rolling_window | def _rolling_window(a, window, axis=-1):
"""
Make an ndarray with a rolling window along axis.
Parameters
----------
a : array_like
Array to add rolling window to
axis: int
axis position along which rolling window will be applied.
window : int
Size of rolling window
... | python | def _rolling_window(a, window, axis=-1):
"""
Make an ndarray with a rolling window along axis.
Parameters
----------
a : array_like
Array to add rolling window to
axis: int
axis position along which rolling window will be applied.
window : int
Size of rolling window
... | [
"def",
"_rolling_window",
"(",
"a",
",",
"window",
",",
"axis",
"=",
"-",
"1",
")",
":",
"axis",
"=",
"_validate_axis",
"(",
"a",
",",
"axis",
")",
"a",
"=",
"np",
".",
"swapaxes",
"(",
"a",
",",
"axis",
",",
"-",
"1",
")",
"if",
"window",
"<",... | Make an ndarray with a rolling window along axis.
Parameters
----------
a : array_like
Array to add rolling window to
axis: int
axis position along which rolling window will be applied.
window : int
Size of rolling window
Returns
-------
Array that is a view of ... | [
"Make",
"an",
"ndarray",
"with",
"a",
"rolling",
"window",
"along",
"axis",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/nputils.py#L157-L203 | train | Return an array_like object with a rolling window along an axis. | 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 | _get_virtual_variable | def _get_virtual_variable(variables, key, level_vars=None, dim_sizes=None):
"""Get a virtual variable (e.g., 'time.year' or a MultiIndex level)
from a dict of xarray.Variable objects (if possible)
"""
if level_vars is None:
level_vars = {}
if dim_sizes is None:
dim_sizes = {}
if... | python | def _get_virtual_variable(variables, key, level_vars=None, dim_sizes=None):
"""Get a virtual variable (e.g., 'time.year' or a MultiIndex level)
from a dict of xarray.Variable objects (if possible)
"""
if level_vars is None:
level_vars = {}
if dim_sizes is None:
dim_sizes = {}
if... | [
"def",
"_get_virtual_variable",
"(",
"variables",
",",
"key",
",",
"level_vars",
"=",
"None",
",",
"dim_sizes",
"=",
"None",
")",
":",
"if",
"level_vars",
"is",
"None",
":",
"level_vars",
"=",
"{",
"}",
"if",
"dim_sizes",
"is",
"None",
":",
"dim_sizes",
... | Get a virtual variable (e.g., 'time.year' or a MultiIndex level)
from a dict of xarray.Variable objects (if possible) | [
"Get",
"a",
"virtual",
"variable",
"(",
"e",
".",
"g",
".",
"time",
".",
"year",
"or",
"a",
"MultiIndex",
"level",
")",
"from",
"a",
"dict",
"of",
"xarray",
".",
"Variable",
"objects",
"(",
"if",
"possible",
")"
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L53-L95 | train | Get a virtual variable from a dict of xarray. Variable objects or MultiIndex 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 | calculate_dimensions | def calculate_dimensions(variables):
"""Calculate the dimensions corresponding to a set of variables.
Returns dictionary mapping from dimension names to sizes. Raises ValueError
if any of the dimension sizes conflict.
"""
dims = OrderedDict()
last_used = {}
scalar_vars = set(k for k, v in v... | python | def calculate_dimensions(variables):
"""Calculate the dimensions corresponding to a set of variables.
Returns dictionary mapping from dimension names to sizes. Raises ValueError
if any of the dimension sizes conflict.
"""
dims = OrderedDict()
last_used = {}
scalar_vars = set(k for k, v in v... | [
"def",
"calculate_dimensions",
"(",
"variables",
")",
":",
"dims",
"=",
"OrderedDict",
"(",
")",
"last_used",
"=",
"{",
"}",
"scalar_vars",
"=",
"set",
"(",
"k",
"for",
"k",
",",
"v",
"in",
"variables",
".",
"items",
"(",
")",
"if",
"not",
"v",
".",
... | Calculate the dimensions corresponding to a set of variables.
Returns dictionary mapping from dimension names to sizes. Raises ValueError
if any of the dimension sizes conflict. | [
"Calculate",
"the",
"dimensions",
"corresponding",
"to",
"a",
"set",
"of",
"variables",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L98-L119 | train | Calculate the dimensions corresponding to a 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/dataset.py | merge_indexes | def merge_indexes(
indexes, # type: Dict[Any, Union[Any, List[Any]]]
variables, # type: Dict[Any, Variable]
coord_names, # type: Set
append=False, # type: bool
):
# type: (...) -> Tuple[OrderedDict[Any, Variable], Set]
"""Merge variables into multi-indexes.
Not public AP... | python | def merge_indexes(
indexes, # type: Dict[Any, Union[Any, List[Any]]]
variables, # type: Dict[Any, Variable]
coord_names, # type: Set
append=False, # type: bool
):
# type: (...) -> Tuple[OrderedDict[Any, Variable], Set]
"""Merge variables into multi-indexes.
Not public AP... | [
"def",
"merge_indexes",
"(",
"indexes",
",",
"# type: Dict[Any, Union[Any, List[Any]]]",
"variables",
",",
"# type: Dict[Any, Variable]",
"coord_names",
",",
"# type: Set",
"append",
"=",
"False",
",",
"# type: bool",
")",
":",
"# type: (...) -> Tuple[OrderedDict[Any, Variable]... | Merge variables into multi-indexes.
Not public API. Used in Dataset and DataArray set_index
methods. | [
"Merge",
"variables",
"into",
"multi",
"-",
"indexes",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L122-L191 | train | Merges the given indexes into a single multi - 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/dataset.py | split_indexes | def split_indexes(
dims_or_levels, # type: Union[Any, List[Any]]
variables, # type: OrderedDict[Any, Variable]
coord_names, # type: Set
level_coords, # type: Dict[Any, Any]
drop=False, # type: bool
):
# type: (...) -> Tuple[OrderedDict[Any, Variable], Set]
"""Extract (multi-)indexes (le... | python | def split_indexes(
dims_or_levels, # type: Union[Any, List[Any]]
variables, # type: OrderedDict[Any, Variable]
coord_names, # type: Set
level_coords, # type: Dict[Any, Any]
drop=False, # type: bool
):
# type: (...) -> Tuple[OrderedDict[Any, Variable], Set]
"""Extract (multi-)indexes (le... | [
"def",
"split_indexes",
"(",
"dims_or_levels",
",",
"# type: Union[Any, List[Any]]",
"variables",
",",
"# type: OrderedDict[Any, Variable]",
"coord_names",
",",
"# type: Set",
"level_coords",
",",
"# type: Dict[Any, Any]",
"drop",
"=",
"False",
",",
"# type: bool",
")",
":"... | Extract (multi-)indexes (levels) as variables.
Not public API. Used in Dataset and DataArray reset_index
methods. | [
"Extract",
"(",
"multi",
"-",
")",
"indexes",
"(",
"levels",
")",
"as",
"variables",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L194-L250 | train | Splits the indexes of a single object into two sets 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/dataset.py | as_dataset | def as_dataset(obj):
"""Cast the given object to a Dataset.
Handles Datasets, DataArrays and dictionaries of variables. A new Dataset
object is only created if the provided object is not already one.
"""
if hasattr(obj, 'to_dataset'):
obj = obj.to_dataset()
if not isinstance(obj, Datase... | python | def as_dataset(obj):
"""Cast the given object to a Dataset.
Handles Datasets, DataArrays and dictionaries of variables. A new Dataset
object is only created if the provided object is not already one.
"""
if hasattr(obj, 'to_dataset'):
obj = obj.to_dataset()
if not isinstance(obj, Datase... | [
"def",
"as_dataset",
"(",
"obj",
")",
":",
"if",
"hasattr",
"(",
"obj",
",",
"'to_dataset'",
")",
":",
"obj",
"=",
"obj",
".",
"to_dataset",
"(",
")",
"if",
"not",
"isinstance",
"(",
"obj",
",",
"Dataset",
")",
":",
"obj",
"=",
"Dataset",
"(",
"obj... | Cast the given object to a Dataset.
Handles Datasets, DataArrays and dictionaries of variables. A new Dataset
object is only created if the provided object is not already one. | [
"Cast",
"the",
"given",
"object",
"to",
"a",
"Dataset",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L258-L268 | train | Cast the given object to a 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 | DataVariables._ipython_key_completions_ | def _ipython_key_completions_(self):
"""Provide method for the key-autocompletions in IPython. """
return [key for key in self._dataset._ipython_key_completions_()
if key not in self._dataset._coord_names] | python | def _ipython_key_completions_(self):
"""Provide method for the key-autocompletions in IPython. """
return [key for key in self._dataset._ipython_key_completions_()
if key not in self._dataset._coord_names] | [
"def",
"_ipython_key_completions_",
"(",
"self",
")",
":",
"return",
"[",
"key",
"for",
"key",
"in",
"self",
".",
"_dataset",
".",
"_ipython_key_completions_",
"(",
")",
"if",
"key",
"not",
"in",
"self",
".",
"_dataset",
".",
"_coord_names",
"]"
] | 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/dataset.py#L300-L303 | train | Provide method for the key - completer 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/dataset.py | Dataset._set_init_vars_and_dims | def _set_init_vars_and_dims(self, data_vars, coords, compat):
"""Set the initial value of Dataset variables and dimensions
"""
both_data_and_coords = [k for k in data_vars if k in coords]
if both_data_and_coords:
raise ValueError('variables %r are found in both data_vars and ... | python | def _set_init_vars_and_dims(self, data_vars, coords, compat):
"""Set the initial value of Dataset variables and dimensions
"""
both_data_and_coords = [k for k in data_vars if k in coords]
if both_data_and_coords:
raise ValueError('variables %r are found in both data_vars and ... | [
"def",
"_set_init_vars_and_dims",
"(",
"self",
",",
"data_vars",
",",
"coords",
",",
"compat",
")",
":",
"both_data_and_coords",
"=",
"[",
"k",
"for",
"k",
"in",
"data_vars",
"if",
"k",
"in",
"coords",
"]",
"if",
"both_data_and_coords",
":",
"raise",
"ValueE... | Set the initial value of Dataset variables and dimensions | [
"Set",
"the",
"initial",
"value",
"of",
"Dataset",
"variables",
"and",
"dimensions"
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L393-L409 | train | Set the initial value of Dataset variables and 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.load_store | def load_store(cls, store, decoder=None):
"""Create a new dataset from the contents of a backends.*DataStore
object
"""
variables, attributes = store.load()
if decoder:
variables, attributes = decoder(variables, attributes)
obj = cls(variables, attrs=attribute... | python | def load_store(cls, store, decoder=None):
"""Create a new dataset from the contents of a backends.*DataStore
object
"""
variables, attributes = store.load()
if decoder:
variables, attributes = decoder(variables, attributes)
obj = cls(variables, attrs=attribute... | [
"def",
"load_store",
"(",
"cls",
",",
"store",
",",
"decoder",
"=",
"None",
")",
":",
"variables",
",",
"attributes",
"=",
"store",
".",
"load",
"(",
")",
"if",
"decoder",
":",
"variables",
",",
"attributes",
"=",
"decoder",
"(",
"variables",
",",
"att... | Create a new dataset from the contents of a backends.*DataStore
object | [
"Create",
"a",
"new",
"dataset",
"from",
"the",
"contents",
"of",
"a",
"backends",
".",
"*",
"DataStore",
"object"
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L412-L421 | train | Create a new dataset from the contents of a backends. DataStore 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/dataset.py | Dataset.attrs | def attrs(self) -> Mapping:
"""Dictionary of global attributes on this dataset
"""
if self._attrs is None:
self._attrs = OrderedDict()
return self._attrs | python | def attrs(self) -> Mapping:
"""Dictionary of global attributes on this dataset
"""
if self._attrs is None:
self._attrs = OrderedDict()
return self._attrs | [
"def",
"attrs",
"(",
"self",
")",
"->",
"Mapping",
":",
"if",
"self",
".",
"_attrs",
"is",
"None",
":",
"self",
".",
"_attrs",
"=",
"OrderedDict",
"(",
")",
"return",
"self",
".",
"_attrs"
] | Dictionary of global attributes on this dataset | [
"Dictionary",
"of",
"global",
"attributes",
"on",
"this",
"dataset"
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L435-L440 | train | Dictionary of global attributes on 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.load | def load(self: T, **kwargs) -> T:
"""Manually trigger loading of this dataset's data from disk or a
remote source into memory and return this dataset.
Normally, it should not be necessary to call this method in user code,
because all xarray functions should either work on deferred data ... | python | def load(self: T, **kwargs) -> T:
"""Manually trigger loading of this dataset's data from disk or a
remote source into memory and return this dataset.
Normally, it should not be necessary to call this method in user code,
because all xarray functions should either work on deferred data ... | [
"def",
"load",
"(",
"self",
":",
"T",
",",
"*",
"*",
"kwargs",
")",
"->",
"T",
":",
"# access .data to coerce everything to numpy or dask arrays",
"lazy_data",
"=",
"{",
"k",
":",
"v",
".",
"_data",
"for",
"k",
",",
"v",
"in",
"self",
".",
"variables",
"... | Manually trigger loading of this dataset's data from disk or a
remote source into memory and return this dataset.
Normally, it should not be necessary to call this method in user code,
because all xarray functions should either work on deferred data or
load data automatically. However, ... | [
"Manually",
"trigger",
"loading",
"of",
"this",
"dataset",
"s",
"data",
"from",
"disk",
"or",
"a",
"remote",
"source",
"into",
"memory",
"and",
"return",
"this",
"dataset",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L485-L520 | train | Manually trigger loading of this dataset s data from disk or remote source into memory and return 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.compute | def compute(self: T, **kwargs) -> T:
"""Manually trigger loading of this dataset's data from disk or a
remote source into memory and return a new dataset. The original is
left unaltered.
Normally, it should not be necessary to call this method in user code,
because all xarray fu... | python | def compute(self: T, **kwargs) -> T:
"""Manually trigger loading of this dataset's data from disk or a
remote source into memory and return a new dataset. The original is
left unaltered.
Normally, it should not be necessary to call this method in user code,
because all xarray fu... | [
"def",
"compute",
"(",
"self",
":",
"T",
",",
"*",
"*",
"kwargs",
")",
"->",
"T",
":",
"new",
"=",
"self",
".",
"copy",
"(",
"deep",
"=",
"False",
")",
"return",
"new",
".",
"load",
"(",
"*",
"*",
"kwargs",
")"
] | Manually trigger loading of this dataset's data from disk or a
remote source into memory and return a new dataset. The original is
left unaltered.
Normally, it should not be necessary to call this method in user code,
because all xarray functions should either work on deferred data or
... | [
"Manually",
"trigger",
"loading",
"of",
"this",
"dataset",
"s",
"data",
"from",
"disk",
"or",
"a",
"remote",
"source",
"into",
"memory",
"and",
"return",
"a",
"new",
"dataset",
".",
"The",
"original",
"is",
"left",
"unaltered",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L616-L636 | train | Manually trigger loading of this dataset s data from disk or a
remote source into memory and return a new 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._persist_inplace | def _persist_inplace(self, **kwargs):
""" Persist all Dask arrays in memory """
# access .data to coerce everything to numpy or dask arrays
lazy_data = {k: v._data for k, v in self.variables.items()
if isinstance(v._data, dask_array_type)}
if lazy_data:
i... | python | def _persist_inplace(self, **kwargs):
""" Persist all Dask arrays in memory """
# access .data to coerce everything to numpy or dask arrays
lazy_data = {k: v._data for k, v in self.variables.items()
if isinstance(v._data, dask_array_type)}
if lazy_data:
i... | [
"def",
"_persist_inplace",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"# access .data to coerce everything to numpy or dask arrays",
"lazy_data",
"=",
"{",
"k",
":",
"v",
".",
"_data",
"for",
"k",
",",
"v",
"in",
"self",
".",
"variables",
".",
"items",
... | Persist all Dask arrays in memory | [
"Persist",
"all",
"Dask",
"arrays",
"in",
"memory"
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L638-L652 | train | Persist all the Dask arrays in memory | 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.persist | def persist(self: T, **kwargs) -> T:
""" Trigger computation, keeping data as dask arrays
This operation can be used to trigger computation on underlying dask
arrays, similar to ``.compute()``. However this operation keeps the
data as dask arrays. This is particularly useful when usin... | python | def persist(self: T, **kwargs) -> T:
""" Trigger computation, keeping data as dask arrays
This operation can be used to trigger computation on underlying dask
arrays, similar to ``.compute()``. However this operation keeps the
data as dask arrays. This is particularly useful when usin... | [
"def",
"persist",
"(",
"self",
":",
"T",
",",
"*",
"*",
"kwargs",
")",
"->",
"T",
":",
"new",
"=",
"self",
".",
"copy",
"(",
"deep",
"=",
"False",
")",
"return",
"new",
".",
"_persist_inplace",
"(",
"*",
"*",
"kwargs",
")"
] | Trigger computation, keeping data as dask arrays
This operation can be used to trigger computation on underlying dask
arrays, similar to ``.compute()``. However this operation keeps the
data as dask arrays. This is particularly useful when using the
dask.distributed scheduler and you ... | [
"Trigger",
"computation",
"keeping",
"data",
"as",
"dask",
"arrays"
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L654-L673 | train | Persist the current state of the object to the distributed memory. | 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._construct_direct | def _construct_direct(cls, variables, coord_names, dims, attrs=None,
indexes=None, encoding=None, file_obj=None):
"""Shortcut around __init__ for internal use when we want to skip
costly validation
"""
obj = object.__new__(cls)
obj._variables = variables... | python | def _construct_direct(cls, variables, coord_names, dims, attrs=None,
indexes=None, encoding=None, file_obj=None):
"""Shortcut around __init__ for internal use when we want to skip
costly validation
"""
obj = object.__new__(cls)
obj._variables = variables... | [
"def",
"_construct_direct",
"(",
"cls",
",",
"variables",
",",
"coord_names",
",",
"dims",
",",
"attrs",
"=",
"None",
",",
"indexes",
"=",
"None",
",",
"encoding",
"=",
"None",
",",
"file_obj",
"=",
"None",
")",
":",
"obj",
"=",
"object",
".",
"__new__... | Shortcut around __init__ for internal use when we want to skip
costly validation | [
"Shortcut",
"around",
"__init__",
"for",
"internal",
"use",
"when",
"we",
"want",
"to",
"skip",
"costly",
"validation"
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L676-L690 | train | Construct a new object of the same class with the given variables coord_names dims attrs indexes and file_obj. | 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._replace | def _replace( # type: ignore
self: T,
variables: 'OrderedDict[Any, Variable]' = None,
coord_names: set = None,
dims: Dict[Any, int] = None,
attrs: 'Optional[OrderedDict]' = __default,
indexes: 'Optional[OrderedDict[Any, pd.Index]]' = __default,
encoding: Optional... | python | def _replace( # type: ignore
self: T,
variables: 'OrderedDict[Any, Variable]' = None,
coord_names: set = None,
dims: Dict[Any, int] = None,
attrs: 'Optional[OrderedDict]' = __default,
indexes: 'Optional[OrderedDict[Any, pd.Index]]' = __default,
encoding: Optional... | [
"def",
"_replace",
"(",
"# type: ignore",
"self",
":",
"T",
",",
"variables",
":",
"'OrderedDict[Any, Variable]'",
"=",
"None",
",",
"coord_names",
":",
"set",
"=",
"None",
",",
"dims",
":",
"Dict",
"[",
"Any",
",",
"int",
"]",
"=",
"None",
",",
"attrs",... | Fastpath constructor for internal use.
Returns an object with optionally with replaced attributes.
Explicitly passed arguments are *not* copied when placed on the new
dataset. It is up to the caller to ensure that they have the right type
and are not used elsewhere. | [
"Fastpath",
"constructor",
"for",
"internal",
"use",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L702-L749 | train | Internal method for internal use. | 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._replace_with_new_dims | def _replace_with_new_dims( # type: ignore
self: T,
variables: 'OrderedDict[Any, Variable]' = None,
coord_names: set = None,
attrs: 'Optional[OrderedDict]' = __default,
indexes: 'Optional[OrderedDict[Any, pd.Index]]' = __default,
inplace: bool = False,
) -> T:
... | python | def _replace_with_new_dims( # type: ignore
self: T,
variables: 'OrderedDict[Any, Variable]' = None,
coord_names: set = None,
attrs: 'Optional[OrderedDict]' = __default,
indexes: 'Optional[OrderedDict[Any, pd.Index]]' = __default,
inplace: bool = False,
) -> T:
... | [
"def",
"_replace_with_new_dims",
"(",
"# type: ignore",
"self",
":",
"T",
",",
"variables",
":",
"'OrderedDict[Any, Variable]'",
"=",
"None",
",",
"coord_names",
":",
"set",
"=",
"None",
",",
"attrs",
":",
"'Optional[OrderedDict]'",
"=",
"__default",
",",
"indexes... | Replace variables with recalculated dimensions. | [
"Replace",
"variables",
"with",
"recalculated",
"dimensions",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L751-L762 | train | Replace variables with recalculated 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.copy | def copy(self: T, deep: bool = False, data: Mapping = None) -> T:
"""Returns a copy of this dataset.
If `deep=True`, a deep copy is made of each of the component variables.
Otherwise, a shallow copy of each of the component variable is made, so
that the underlying memory region of the n... | python | def copy(self: T, deep: bool = False, data: Mapping = None) -> T:
"""Returns a copy of this dataset.
If `deep=True`, a deep copy is made of each of the component variables.
Otherwise, a shallow copy of each of the component variable is made, so
that the underlying memory region of the n... | [
"def",
"copy",
"(",
"self",
":",
"T",
",",
"deep",
":",
"bool",
"=",
"False",
",",
"data",
":",
"Mapping",
"=",
"None",
")",
"->",
"T",
":",
"# noqa",
"if",
"data",
"is",
"None",
":",
"variables",
"=",
"OrderedDict",
"(",
"(",
"k",
",",
"v",
".... | Returns a copy of this dataset.
If `deep=True`, a deep copy is made of each of the component variables.
Otherwise, a shallow copy of each of the component variable is made, so
that the underlying memory region of the new dataset is the same as in
the original dataset.
Use `data... | [
"Returns",
"a",
"copy",
"of",
"this",
"dataset",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L802-L920 | train | Returns a shallow copy of the current 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._level_coords | def _level_coords(self):
"""Return a mapping of all MultiIndex levels and their corresponding
coordinate name.
"""
level_coords = OrderedDict()
for name, index in self.indexes.items():
if isinstance(index, pd.MultiIndex):
level_names = index.names
... | python | def _level_coords(self):
"""Return a mapping of all MultiIndex levels and their corresponding
coordinate name.
"""
level_coords = OrderedDict()
for name, index in self.indexes.items():
if isinstance(index, pd.MultiIndex):
level_names = index.names
... | [
"def",
"_level_coords",
"(",
"self",
")",
":",
"level_coords",
"=",
"OrderedDict",
"(",
")",
"for",
"name",
",",
"index",
"in",
"self",
".",
"indexes",
".",
"items",
"(",
")",
":",
"if",
"isinstance",
"(",
"index",
",",
"pd",
".",
"MultiIndex",
")",
... | Return a mapping of all MultiIndex levels and their corresponding
coordinate name. | [
"Return",
"a",
"mapping",
"of",
"all",
"MultiIndex",
"levels",
"and",
"their",
"corresponding",
"coordinate",
"name",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L923-L933 | train | Return a mapping of all MultiIndex levels and their corresponding
coordinate name. | 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._copy_listed | def _copy_listed(self: T, names) -> T:
"""Create a new Dataset with the listed variables from this dataset and
the all relevant coordinates. Skips all validation.
"""
variables = OrderedDict() # type: OrderedDict[Any, Variable]
coord_names = set()
indexes = OrderedDict()... | python | def _copy_listed(self: T, names) -> T:
"""Create a new Dataset with the listed variables from this dataset and
the all relevant coordinates. Skips all validation.
"""
variables = OrderedDict() # type: OrderedDict[Any, Variable]
coord_names = set()
indexes = OrderedDict()... | [
"def",
"_copy_listed",
"(",
"self",
":",
"T",
",",
"names",
")",
"->",
"T",
":",
"variables",
"=",
"OrderedDict",
"(",
")",
"# type: OrderedDict[Any, Variable]",
"coord_names",
"=",
"set",
"(",
")",
"indexes",
"=",
"OrderedDict",
"(",
")",
"# type: OrderedDict... | Create a new Dataset with the listed variables from this dataset and
the all relevant coordinates. Skips all validation. | [
"Create",
"a",
"new",
"Dataset",
"with",
"the",
"listed",
"variables",
"from",
"this",
"dataset",
"and",
"the",
"all",
"relevant",
"coordinates",
".",
"Skips",
"all",
"validation",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L935-L968 | train | Create a new Dataset with the listed variables from this dataset and the all relevant coordinates. Skips all validation. | 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._construct_dataarray | def _construct_dataarray(self, name) -> 'DataArray':
"""Construct a DataArray by indexing this dataset
"""
from .dataarray import DataArray
try:
variable = self._variables[name]
except KeyError:
_, name, variable = _get_virtual_variable(
s... | python | def _construct_dataarray(self, name) -> 'DataArray':
"""Construct a DataArray by indexing this dataset
"""
from .dataarray import DataArray
try:
variable = self._variables[name]
except KeyError:
_, name, variable = _get_virtual_variable(
s... | [
"def",
"_construct_dataarray",
"(",
"self",
",",
"name",
")",
"->",
"'DataArray'",
":",
"from",
".",
"dataarray",
"import",
"DataArray",
"try",
":",
"variable",
"=",
"self",
".",
"_variables",
"[",
"name",
"]",
"except",
"KeyError",
":",
"_",
",",
"name",
... | Construct a DataArray by indexing this dataset | [
"Construct",
"a",
"DataArray",
"by",
"indexing",
"this",
"dataset"
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L970-L995 | train | Construct a DataArray by indexing 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._item_sources | def _item_sources(self):
"""List of places to look-up items for key-completion"""
return [self.data_vars, self.coords, {d: self[d] for d in self.dims},
LevelCoordinatesSource(self)] | python | def _item_sources(self):
"""List of places to look-up items for key-completion"""
return [self.data_vars, self.coords, {d: self[d] for d in self.dims},
LevelCoordinatesSource(self)] | [
"def",
"_item_sources",
"(",
"self",
")",
":",
"return",
"[",
"self",
".",
"data_vars",
",",
"self",
".",
"coords",
",",
"{",
"d",
":",
"self",
"[",
"d",
"]",
"for",
"d",
"in",
"self",
".",
"dims",
"}",
",",
"LevelCoordinatesSource",
"(",
"self",
"... | List of places to look-up items for key-completion | [
"List",
"of",
"places",
"to",
"look",
"-",
"up",
"items",
"for",
"key",
"-",
"completion"
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L1011-L1014 | train | List of items to look - up for key - completion | 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._all_compat | def _all_compat(self, other, compat_str):
"""Helper function for equals and identical"""
# some stores (e.g., scipy) do not seem to preserve order, so don't
# require matching order for equality
def compat(x, y):
return getattr(x, compat_str)(y)
return (self._coord_... | python | def _all_compat(self, other, compat_str):
"""Helper function for equals and identical"""
# some stores (e.g., scipy) do not seem to preserve order, so don't
# require matching order for equality
def compat(x, y):
return getattr(x, compat_str)(y)
return (self._coord_... | [
"def",
"_all_compat",
"(",
"self",
",",
"other",
",",
"compat_str",
")",
":",
"# some stores (e.g., scipy) do not seem to preserve order, so don't",
"# require matching order for equality",
"def",
"compat",
"(",
"x",
",",
"y",
")",
":",
"return",
"getattr",
"(",
"x",
... | Helper function for equals and identical | [
"Helper",
"function",
"for",
"equals",
"and",
"identical"
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L1089-L1099 | train | Helper function for equals and identical | 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.indexes | def indexes(self) -> 'Mapping[Any, pd.Index]':
"""Mapping of pandas.Index objects used for label based indexing
"""
if self._indexes is None:
self._indexes = default_indexes(self._variables, self._dims)
return Indexes(self._indexes) | python | def indexes(self) -> 'Mapping[Any, pd.Index]':
"""Mapping of pandas.Index objects used for label based indexing
"""
if self._indexes is None:
self._indexes = default_indexes(self._variables, self._dims)
return Indexes(self._indexes) | [
"def",
"indexes",
"(",
"self",
")",
"->",
"'Mapping[Any, pd.Index]'",
":",
"if",
"self",
".",
"_indexes",
"is",
"None",
":",
"self",
".",
"_indexes",
"=",
"default_indexes",
"(",
"self",
".",
"_variables",
",",
"self",
".",
"_dims",
")",
"return",
"Indexes... | Mapping of pandas.Index objects used for label based indexing | [
"Mapping",
"of",
"pandas",
".",
"Index",
"objects",
"used",
"for",
"label",
"based",
"indexing"
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L1155-L1160 | train | Mapping of pandas. Index objects used for label based indexing. | 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.set_coords | def set_coords(self, names, inplace=None):
"""Given names of one or more variables, set them as coordinates
Parameters
----------
names : str or list of str
Name(s) of variables in this dataset to convert into coordinates.
inplace : bool, optional
If True... | python | def set_coords(self, names, inplace=None):
"""Given names of one or more variables, set them as coordinates
Parameters
----------
names : str or list of str
Name(s) of variables in this dataset to convert into coordinates.
inplace : bool, optional
If True... | [
"def",
"set_coords",
"(",
"self",
",",
"names",
",",
"inplace",
"=",
"None",
")",
":",
"# TODO: allow inserting new coordinates with this method, like",
"# DataFrame.set_index?",
"# nb. check in self._variables, not self.data_vars to insure that the",
"# operation is idempotent",
"in... | Given names of one or more variables, set them as coordinates
Parameters
----------
names : str or list of str
Name(s) of variables in this dataset to convert into coordinates.
inplace : bool, optional
If True, modify this dataset inplace. Otherwise, create a new... | [
"Given",
"names",
"of",
"one",
"or",
"more",
"variables",
"set",
"them",
"as",
"coordinates"
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L1175-L1204 | train | Set the names of one or more variables as coordinates in 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.reset_coords | def reset_coords(self, names=None, drop=False, inplace=None):
"""Given names of coordinates, reset them to become variables
Parameters
----------
names : str or list of str, optional
Name(s) of non-index coordinates in this dataset to reset into
variables. By def... | python | def reset_coords(self, names=None, drop=False, inplace=None):
"""Given names of coordinates, reset them to become variables
Parameters
----------
names : str or list of str, optional
Name(s) of non-index coordinates in this dataset to reset into
variables. By def... | [
"def",
"reset_coords",
"(",
"self",
",",
"names",
"=",
"None",
",",
"drop",
"=",
"False",
",",
"inplace",
"=",
"None",
")",
":",
"inplace",
"=",
"_check_inplace",
"(",
"inplace",
")",
"if",
"names",
"is",
"None",
":",
"names",
"=",
"self",
".",
"_coo... | Given names of coordinates, reset them to become variables
Parameters
----------
names : str or list of str, optional
Name(s) of non-index coordinates in this dataset to reset into
variables. By default, all non-index coordinates are reset.
drop : bool, optional
... | [
"Given",
"names",
"of",
"coordinates",
"reset",
"them",
"to",
"become",
"variables"
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L1206-L1242 | train | Reset the coordinates of the specified names of variables in this dataset to become 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.dump_to_store | def dump_to_store(self, store, **kwargs):
"""Store dataset contents to a backends.*DataStore object."""
from ..backends.api import dump_to_store
# TODO: rename and/or cleanup this method to make it more consistent
# with to_netcdf()
return dump_to_store(self, store, **kwargs) | python | def dump_to_store(self, store, **kwargs):
"""Store dataset contents to a backends.*DataStore object."""
from ..backends.api import dump_to_store
# TODO: rename and/or cleanup this method to make it more consistent
# with to_netcdf()
return dump_to_store(self, store, **kwargs) | [
"def",
"dump_to_store",
"(",
"self",
",",
"store",
",",
"*",
"*",
"kwargs",
")",
":",
"from",
".",
".",
"backends",
".",
"api",
"import",
"dump_to_store",
"# TODO: rename and/or cleanup this method to make it more consistent",
"# with to_netcdf()",
"return",
"dump_to_st... | Store dataset contents to a backends.*DataStore object. | [
"Store",
"dataset",
"contents",
"to",
"a",
"backends",
".",
"*",
"DataStore",
"object",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L1244-L1249 | train | Store dataset contents to a backends. DataStore 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/dataset.py | Dataset.to_netcdf | def to_netcdf(self, path=None, mode='w', format=None, group=None,
engine=None, encoding=None, unlimited_dims=None,
compute=True):
"""Write dataset contents to a netCDF file.
Parameters
----------
path : str, Path or file-like object, optional
... | python | def to_netcdf(self, path=None, mode='w', format=None, group=None,
engine=None, encoding=None, unlimited_dims=None,
compute=True):
"""Write dataset contents to a netCDF file.
Parameters
----------
path : str, Path or file-like object, optional
... | [
"def",
"to_netcdf",
"(",
"self",
",",
"path",
"=",
"None",
",",
"mode",
"=",
"'w'",
",",
"format",
"=",
"None",
",",
"group",
"=",
"None",
",",
"engine",
"=",
"None",
",",
"encoding",
"=",
"None",
",",
"unlimited_dims",
"=",
"None",
",",
"compute",
... | Write dataset contents to a netCDF file.
Parameters
----------
path : str, Path or file-like object, optional
Path to which to save this dataset. File-like objects are only
supported by the scipy engine. If no path is provided, this
function returns the resul... | [
"Write",
"dataset",
"contents",
"to",
"a",
"netCDF",
"file",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L1251-L1323 | train | Write the contents of this object to a netCDF file. | 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_zarr | def to_zarr(self, store=None, mode='w-', synchronizer=None, group=None,
encoding=None, compute=True, consolidated=False):
"""Write dataset contents to a zarr group.
.. note:: Experimental
The Zarr backend is new and experimental. Please report any
une... | python | def to_zarr(self, store=None, mode='w-', synchronizer=None, group=None,
encoding=None, compute=True, consolidated=False):
"""Write dataset contents to a zarr group.
.. note:: Experimental
The Zarr backend is new and experimental. Please report any
une... | [
"def",
"to_zarr",
"(",
"self",
",",
"store",
"=",
"None",
",",
"mode",
"=",
"'w-'",
",",
"synchronizer",
"=",
"None",
",",
"group",
"=",
"None",
",",
"encoding",
"=",
"None",
",",
"compute",
"=",
"True",
",",
"consolidated",
"=",
"False",
")",
":",
... | Write dataset contents to a zarr group.
.. note:: Experimental
The Zarr backend is new and experimental. Please report any
unexpected behavior via github issues.
Parameters
----------
store : MutableMapping or str, optional
Store or path ... | [
"Write",
"dataset",
"contents",
"to",
"a",
"zarr",
"group",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L1325-L1368 | train | Write the contents of this object to a zarr group. | 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.info | def info(self, buf=None):
"""
Concise summary of a Dataset variables and attributes.
Parameters
----------
buf : writable buffer, defaults to sys.stdout
See Also
--------
pandas.DataFrame.assign
netCDF's ncdump
"""
if buf is None... | python | def info(self, buf=None):
"""
Concise summary of a Dataset variables and attributes.
Parameters
----------
buf : writable buffer, defaults to sys.stdout
See Also
--------
pandas.DataFrame.assign
netCDF's ncdump
"""
if buf is None... | [
"def",
"info",
"(",
"self",
",",
"buf",
"=",
"None",
")",
":",
"if",
"buf",
"is",
"None",
":",
"# pragma: no cover",
"buf",
"=",
"sys",
".",
"stdout",
"lines",
"=",
"[",
"]",
"lines",
".",
"append",
"(",
"'xarray.Dataset {'",
")",
"lines",
".",
"appe... | Concise summary of a Dataset variables and attributes.
Parameters
----------
buf : writable buffer, defaults to sys.stdout
See Also
--------
pandas.DataFrame.assign
netCDF's ncdump | [
"Concise",
"summary",
"of",
"a",
"Dataset",
"variables",
"and",
"attributes",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L1373-L1408 | train | Prints out a summary of the current state of the 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/dataset.py | Dataset.chunks | def chunks(self):
"""Block dimensions for this dataset's data or None if it's not a dask
array.
"""
chunks = {}
for v in self.variables.values():
if v.chunks is not None:
for dim, c in zip(v.dims, v.chunks):
if dim in chunks and c !... | python | def chunks(self):
"""Block dimensions for this dataset's data or None if it's not a dask
array.
"""
chunks = {}
for v in self.variables.values():
if v.chunks is not None:
for dim, c in zip(v.dims, v.chunks):
if dim in chunks and c !... | [
"def",
"chunks",
"(",
"self",
")",
":",
"chunks",
"=",
"{",
"}",
"for",
"v",
"in",
"self",
".",
"variables",
".",
"values",
"(",
")",
":",
"if",
"v",
".",
"chunks",
"is",
"not",
"None",
":",
"for",
"dim",
",",
"c",
"in",
"zip",
"(",
"v",
".",... | Block dimensions for this dataset's data or None if it's not a dask
array. | [
"Block",
"dimensions",
"for",
"this",
"dataset",
"s",
"data",
"or",
"None",
"if",
"it",
"s",
"not",
"a",
"dask",
"array",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L1411-L1422 | train | Returns a Frozen dictionary of the block dimensions for this dataset s data or None if it s not a dask
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/dataset.py | Dataset.chunk | def chunk(self, chunks=None, name_prefix='xarray-', token=None,
lock=False):
"""Coerce all arrays in this dataset into dask arrays with the given
chunks.
Non-dask arrays in this dataset will be converted to dask arrays. Dask
arrays will be rechunked to the given chunk size... | python | def chunk(self, chunks=None, name_prefix='xarray-', token=None,
lock=False):
"""Coerce all arrays in this dataset into dask arrays with the given
chunks.
Non-dask arrays in this dataset will be converted to dask arrays. Dask
arrays will be rechunked to the given chunk size... | [
"def",
"chunk",
"(",
"self",
",",
"chunks",
"=",
"None",
",",
"name_prefix",
"=",
"'xarray-'",
",",
"token",
"=",
"None",
",",
"lock",
"=",
"False",
")",
":",
"try",
":",
"from",
"dask",
".",
"base",
"import",
"tokenize",
"except",
"ImportError",
":",
... | Coerce all arrays in this dataset into dask arrays with the given
chunks.
Non-dask arrays in this dataset will be converted to dask arrays. Dask
arrays will be rechunked to the given chunk sizes.
If neither chunks is not provided for one or more dimensions, chunk
sizes along th... | [
"Coerce",
"all",
"arrays",
"in",
"this",
"dataset",
"into",
"dask",
"arrays",
"with",
"the",
"given",
"chunks",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L1424-L1487 | train | Coerce all arrays in this dataset into dask arrays with the given chunk sizes along each 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._validate_indexers | def _validate_indexers(
self, indexers: Mapping,
) -> List[Tuple[Any, Union[slice, Variable]]]:
""" Here we make sure
+ indexer has a valid keys
+ indexer is in a valid data type
+ string indexers are cast to the appropriate date type if the
associated index is a Da... | python | def _validate_indexers(
self, indexers: Mapping,
) -> List[Tuple[Any, Union[slice, Variable]]]:
""" Here we make sure
+ indexer has a valid keys
+ indexer is in a valid data type
+ string indexers are cast to the appropriate date type if the
associated index is a Da... | [
"def",
"_validate_indexers",
"(",
"self",
",",
"indexers",
":",
"Mapping",
",",
")",
"->",
"List",
"[",
"Tuple",
"[",
"Any",
",",
"Union",
"[",
"slice",
",",
"Variable",
"]",
"]",
"]",
":",
"from",
".",
"dataarray",
"import",
"DataArray",
"invalid",
"=... | Here we make sure
+ indexer has a valid keys
+ indexer is in a valid data type
+ string indexers are cast to the appropriate date type if the
associated index is a DatetimeIndex or CFTimeIndex | [
"Here",
"we",
"make",
"sure",
"+",
"indexer",
"has",
"a",
"valid",
"keys",
"+",
"indexer",
"is",
"in",
"a",
"valid",
"data",
"type",
"+",
"string",
"indexers",
"are",
"cast",
"to",
"the",
"appropriate",
"date",
"type",
"if",
"the",
"associated",
"index",... | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L1489-L1545 | train | This function checks that the indexers are valid and returns a list of tuples that can be used to create the new 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/dataset.py | Dataset._get_indexers_coords_and_indexes | def _get_indexers_coords_and_indexes(self, indexers):
""" Extract coordinates from indexers.
Returns an OrderedDict mapping from coordinate name to the
coordinate variable.
Only coordinate with a name different from any of self.variables will
be attached.
"""
fr... | python | def _get_indexers_coords_and_indexes(self, indexers):
""" Extract coordinates from indexers.
Returns an OrderedDict mapping from coordinate name to the
coordinate variable.
Only coordinate with a name different from any of self.variables will
be attached.
"""
fr... | [
"def",
"_get_indexers_coords_and_indexes",
"(",
"self",
",",
"indexers",
")",
":",
"from",
".",
"dataarray",
"import",
"DataArray",
"coord_list",
"=",
"[",
"]",
"indexes",
"=",
"OrderedDict",
"(",
")",
"for",
"k",
",",
"v",
"in",
"indexers",
".",
"items",
... | Extract coordinates from indexers.
Returns an OrderedDict mapping from coordinate name to the
coordinate variable.
Only coordinate with a name different from any of self.variables will
be attached. | [
"Extract",
"coordinates",
"from",
"indexers",
".",
"Returns",
"an",
"OrderedDict",
"mapping",
"from",
"coordinate",
"name",
"to",
"the",
"coordinate",
"variable",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L1547-L1588 | train | Extract coordinates from indexers. indexers returns an OrderedDict mapping from coordinate name to the corresponding coordinate 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/core/dataset.py | Dataset.isel | def isel(self, indexers=None, drop=False, **indexers_kwargs):
"""Returns a new dataset with each array indexed along the specified
dimension(s).
This method selects values from each array using its `__getitem__`
method, except this method does not require knowing the order of
ea... | python | def isel(self, indexers=None, drop=False, **indexers_kwargs):
"""Returns a new dataset with each array indexed along the specified
dimension(s).
This method selects values from each array using its `__getitem__`
method, except this method does not require knowing the order of
ea... | [
"def",
"isel",
"(",
"self",
",",
"indexers",
"=",
"None",
",",
"drop",
"=",
"False",
",",
"*",
"*",
"indexers_kwargs",
")",
":",
"indexers",
"=",
"either_dict_or_kwargs",
"(",
"indexers",
",",
"indexers_kwargs",
",",
"'isel'",
")",
"indexers_list",
"=",
"s... | Returns a new dataset with each array indexed along the specified
dimension(s).
This method selects values from each array using its `__getitem__`
method, except this method does not require knowing the order of
each array's dimensions.
Parameters
----------
ind... | [
"Returns",
"a",
"new",
"dataset",
"with",
"each",
"array",
"indexed",
"along",
"the",
"specified",
"dimension",
"(",
"s",
")",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L1590-L1665 | train | Returns a new Dataset with each array indexed 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.sel | def sel(self, indexers=None, method=None, tolerance=None, drop=False,
**indexers_kwargs):
"""Returns a new dataset with each array indexed by tick labels
along the specified dimension(s).
In contrast to `Dataset.isel`, indexers for this method should use
labels instead of in... | python | def sel(self, indexers=None, method=None, tolerance=None, drop=False,
**indexers_kwargs):
"""Returns a new dataset with each array indexed by tick labels
along the specified dimension(s).
In contrast to `Dataset.isel`, indexers for this method should use
labels instead of in... | [
"def",
"sel",
"(",
"self",
",",
"indexers",
"=",
"None",
",",
"method",
"=",
"None",
",",
"tolerance",
"=",
"None",
",",
"drop",
"=",
"False",
",",
"*",
"*",
"indexers_kwargs",
")",
":",
"indexers",
"=",
"either_dict_or_kwargs",
"(",
"indexers",
",",
"... | Returns a new dataset with each array indexed by tick labels
along the specified dimension(s).
In contrast to `Dataset.isel`, indexers for this method should use
labels instead of integers.
Under the hood, this method is powered by using pandas's powerful Index
objects. This ma... | [
"Returns",
"a",
"new",
"dataset",
"with",
"each",
"array",
"indexed",
"by",
"tick",
"labels",
"along",
"the",
"specified",
"dimension",
"(",
"s",
")",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L1667-L1735 | train | Returns a new dataset with each array indexed by tick labels and optionally by tick labels. | 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.isel_points | def isel_points(self, dim='points', **indexers):
# type: (...) -> Dataset
"""Returns a new dataset with each array indexed pointwise along the
specified dimension(s).
This method selects pointwise values from each array and is akin to
the NumPy indexing behavior of `arr[[0, 1], ... | python | def isel_points(self, dim='points', **indexers):
# type: (...) -> Dataset
"""Returns a new dataset with each array indexed pointwise along the
specified dimension(s).
This method selects pointwise values from each array and is akin to
the NumPy indexing behavior of `arr[[0, 1], ... | [
"def",
"isel_points",
"(",
"self",
",",
"dim",
"=",
"'points'",
",",
"*",
"*",
"indexers",
")",
":",
"# type: (...) -> Dataset",
"# noqa",
"warnings",
".",
"warn",
"(",
"'Dataset.isel_points is deprecated: use Dataset.isel()'",
"'instead.'",
",",
"DeprecationWarning",
... | Returns a new dataset with each array indexed pointwise along the
specified dimension(s).
This method selects pointwise values from each array and is akin to
the NumPy indexing behavior of `arr[[0, 1], [0, 1]]`, except this
method does not require knowing the order of each array's dimen... | [
"Returns",
"a",
"new",
"dataset",
"with",
"each",
"array",
"indexed",
"pointwise",
"along",
"the",
"specified",
"dimension",
"(",
"s",
")",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L1737-L1873 | train | Returns a new Dataset with each array indexed pointwise 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.sel_points | def sel_points(self, dim='points', method=None, tolerance=None,
**indexers):
"""Returns a new dataset with each array indexed pointwise by tick
labels along the specified dimension(s).
In contrast to `Dataset.isel_points`, indexers for this method should
use labels in... | python | def sel_points(self, dim='points', method=None, tolerance=None,
**indexers):
"""Returns a new dataset with each array indexed pointwise by tick
labels along the specified dimension(s).
In contrast to `Dataset.isel_points`, indexers for this method should
use labels in... | [
"def",
"sel_points",
"(",
"self",
",",
"dim",
"=",
"'points'",
",",
"method",
"=",
"None",
",",
"tolerance",
"=",
"None",
",",
"*",
"*",
"indexers",
")",
":",
"# noqa",
"warnings",
".",
"warn",
"(",
"'Dataset.sel_points is deprecated: use Dataset.sel()'",
"'in... | Returns a new dataset with each array indexed pointwise by tick
labels along the specified dimension(s).
In contrast to `Dataset.isel_points`, indexers for this method should
use labels instead of integers.
In contrast to `Dataset.sel`, this method selects points along the
diag... | [
"Returns",
"a",
"new",
"dataset",
"with",
"each",
"array",
"indexed",
"pointwise",
"by",
"tick",
"labels",
"along",
"the",
"specified",
"dimension",
"(",
"s",
")",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L1875-L1933 | train | Returns a new Dataset with each array indexed pointwise by tick
labels 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.reindex_like | def reindex_like(self, other, method=None, tolerance=None, copy=True):
"""Conform this object onto the indexes of another object, filling
in missing values with NaN.
Parameters
----------
other : Dataset or DataArray
Object with an 'indexes' attribute giving a mappin... | python | def reindex_like(self, other, method=None, tolerance=None, copy=True):
"""Conform this object onto the indexes of another object, filling
in missing values with NaN.
Parameters
----------
other : Dataset or DataArray
Object with an 'indexes' attribute giving a mappin... | [
"def",
"reindex_like",
"(",
"self",
",",
"other",
",",
"method",
"=",
"None",
",",
"tolerance",
"=",
"None",
",",
"copy",
"=",
"True",
")",
":",
"indexers",
"=",
"alignment",
".",
"reindex_like_indexers",
"(",
"self",
",",
"other",
")",
"return",
"self",... | Conform this object onto the indexes of another object, filling
in missing values with NaN.
Parameters
----------
other : Dataset or DataArray
Object with an 'indexes' attribute giving a mapping from dimension
names to pandas.Index objects, which provides coordin... | [
"Conform",
"this",
"object",
"onto",
"the",
"indexes",
"of",
"another",
"object",
"filling",
"in",
"missing",
"values",
"with",
"NaN",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L1935-L1980 | train | Conform this object onto the indexes of another object filling missing values with NaN. | 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.reindex | def reindex(self, indexers=None, method=None, tolerance=None, copy=True,
**indexers_kwargs):
"""Conform this object onto a new set of indexes, filling in
missing values with NaN.
Parameters
----------
indexers : dict. optional
Dictionary with keys giv... | python | def reindex(self, indexers=None, method=None, tolerance=None, copy=True,
**indexers_kwargs):
"""Conform this object onto a new set of indexes, filling in
missing values with NaN.
Parameters
----------
indexers : dict. optional
Dictionary with keys giv... | [
"def",
"reindex",
"(",
"self",
",",
"indexers",
"=",
"None",
",",
"method",
"=",
"None",
",",
"tolerance",
"=",
"None",
",",
"copy",
"=",
"True",
",",
"*",
"*",
"indexers_kwargs",
")",
":",
"indexers",
"=",
"utils",
".",
"either_dict_or_kwargs",
"(",
"... | Conform this object onto a new set of indexes, filling in
missing values with NaN.
Parameters
----------
indexers : dict. optional
Dictionary with keys given by dimension names and values given by
arrays of coordinates tick labels. Any mis-matched coordinate
... | [
"Conform",
"this",
"object",
"onto",
"a",
"new",
"set",
"of",
"indexes",
"filling",
"in",
"missing",
"values",
"with",
"NaN",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L1982-L2041 | train | Conform this object onto a new set of indexes. | 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.interp_like | def interp_like(self, other, method='linear', assume_sorted=False,
kwargs={}):
"""Interpolate this object onto the coordinates of another object,
filling the out of range values with NaN.
Parameters
----------
other : Dataset or DataArray
Object w... | python | def interp_like(self, other, method='linear', assume_sorted=False,
kwargs={}):
"""Interpolate this object onto the coordinates of another object,
filling the out of range values with NaN.
Parameters
----------
other : Dataset or DataArray
Object w... | [
"def",
"interp_like",
"(",
"self",
",",
"other",
",",
"method",
"=",
"'linear'",
",",
"assume_sorted",
"=",
"False",
",",
"kwargs",
"=",
"{",
"}",
")",
":",
"coords",
"=",
"alignment",
".",
"reindex_like_indexers",
"(",
"self",
",",
"other",
")",
"numeri... | Interpolate this object onto the coordinates of another object,
filling the out of range values with NaN.
Parameters
----------
other : Dataset or DataArray
Object with an 'indexes' attribute giving a mapping from dimension
names to an 1d array-like, which provid... | [
"Interpolate",
"this",
"object",
"onto",
"the",
"coordinates",
"of",
"another",
"object",
"filling",
"the",
"out",
"of",
"range",
"values",
"with",
"NaN",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L2150-L2205 | train | Interpolate this object onto the coordinates of another 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/dataset.py | Dataset.rename | def rename(self, name_dict=None, inplace=None, **names):
"""Returns a new object with renamed variables and dimensions.
Parameters
----------
name_dict : dict-like, optional
Dictionary whose keys are current variable or dimension names and
whose values are the de... | python | def rename(self, name_dict=None, inplace=None, **names):
"""Returns a new object with renamed variables and dimensions.
Parameters
----------
name_dict : dict-like, optional
Dictionary whose keys are current variable or dimension names and
whose values are the de... | [
"def",
"rename",
"(",
"self",
",",
"name_dict",
"=",
"None",
",",
"inplace",
"=",
"None",
",",
"*",
"*",
"names",
")",
":",
"# TODO: add separate rename_vars and rename_dims methods.",
"inplace",
"=",
"_check_inplace",
"(",
"inplace",
")",
"name_dict",
"=",
"eit... | Returns a new object with renamed variables and dimensions.
Parameters
----------
name_dict : dict-like, optional
Dictionary whose keys are current variable or dimension names and
whose values are the desired names.
inplace : bool, optional
If True, r... | [
"Returns",
"a",
"new",
"object",
"with",
"renamed",
"variables",
"and",
"dimensions",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L2247-L2283 | train | Returns a new Dataset object with renamed variables and 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.swap_dims | def swap_dims(self, dims_dict, inplace=None):
"""Returns a new object with swapped dimensions.
Parameters
----------
dims_dict : dict-like
Dictionary whose keys are current dimension names and whose values
are new names. Each value must already be a variable in t... | python | def swap_dims(self, dims_dict, inplace=None):
"""Returns a new object with swapped dimensions.
Parameters
----------
dims_dict : dict-like
Dictionary whose keys are current dimension names and whose values
are new names. Each value must already be a variable in t... | [
"def",
"swap_dims",
"(",
"self",
",",
"dims_dict",
",",
"inplace",
"=",
"None",
")",
":",
"# TODO: deprecate this method in favor of a (less confusing)",
"# rename_dims() method that only renames dimensions.",
"inplace",
"=",
"_check_inplace",
"(",
"inplace",
")",
"for",
"k... | Returns a new object with swapped dimensions.
Parameters
----------
dims_dict : dict-like
Dictionary whose keys are current dimension names and whose values
are new names. Each value must already be a variable in the
dataset.
inplace : bool, optional
... | [
"Returns",
"a",
"new",
"object",
"with",
"swapped",
"dimensions",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L2285-L2342 | train | Returns a new Dataset containing swapped 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.expand_dims | def expand_dims(self, dim=None, axis=None, **dim_kwargs):
"""Return a new object with an additional axis (or axes) inserted at
the corresponding position in the array shape.
If dim is already a scalar coordinate, it will be promoted to a 1D
coordinate consisting of a single value.
... | python | def expand_dims(self, dim=None, axis=None, **dim_kwargs):
"""Return a new object with an additional axis (or axes) inserted at
the corresponding position in the array shape.
If dim is already a scalar coordinate, it will be promoted to a 1D
coordinate consisting of a single value.
... | [
"def",
"expand_dims",
"(",
"self",
",",
"dim",
"=",
"None",
",",
"axis",
"=",
"None",
",",
"*",
"*",
"dim_kwargs",
")",
":",
"if",
"isinstance",
"(",
"dim",
",",
"int",
")",
":",
"raise",
"TypeError",
"(",
"'dim should be str or sequence of strs or dict'",
... | Return a new object with an additional axis (or axes) inserted at
the corresponding position in the array shape.
If dim is already a scalar coordinate, it will be promoted to a 1D
coordinate consisting of a single value.
Parameters
----------
dim : str, sequence of str,... | [
"Return",
"a",
"new",
"object",
"with",
"an",
"additional",
"axis",
"(",
"or",
"axes",
")",
"inserted",
"at",
"the",
"corresponding",
"position",
"in",
"the",
"array",
"shape",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L2344-L2474 | train | Return a new object with an additional dimension inserted at the corresponding position in the 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/dataset.py | Dataset.set_index | def set_index(self, indexes=None, append=False, inplace=None,
**indexes_kwargs):
"""Set Dataset (multi-)indexes using one or more existing coordinates
or variables.
Parameters
----------
indexes : {dim: index, ...}
Mapping from names matching dimens... | python | def set_index(self, indexes=None, append=False, inplace=None,
**indexes_kwargs):
"""Set Dataset (multi-)indexes using one or more existing coordinates
or variables.
Parameters
----------
indexes : {dim: index, ...}
Mapping from names matching dimens... | [
"def",
"set_index",
"(",
"self",
",",
"indexes",
"=",
"None",
",",
"append",
"=",
"False",
",",
"inplace",
"=",
"None",
",",
"*",
"*",
"indexes_kwargs",
")",
":",
"inplace",
"=",
"_check_inplace",
"(",
"inplace",
")",
"indexes",
"=",
"either_dict_or_kwargs... | Set Dataset (multi-)indexes using one or more existing coordinates
or variables.
Parameters
----------
indexes : {dim: index, ...}
Mapping from names matching dimensions and values given
by (lists of) the names of existing coordinates or variables to set
... | [
"Set",
"Dataset",
"(",
"multi",
"-",
")",
"indexes",
"using",
"one",
"or",
"more",
"existing",
"coordinates",
"or",
"variables",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L2476-L2513 | train | Set the index of the data for the given locations. | 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.reset_index | def reset_index(self, dims_or_levels, drop=False, inplace=None):
"""Reset the specified index(es) or multi-index level(s).
Parameters
----------
dims_or_levels : str or list
Name(s) of the dimension(s) and/or multi-index level(s) that will
be reset.
drop ... | python | def reset_index(self, dims_or_levels, drop=False, inplace=None):
"""Reset the specified index(es) or multi-index level(s).
Parameters
----------
dims_or_levels : str or list
Name(s) of the dimension(s) and/or multi-index level(s) that will
be reset.
drop ... | [
"def",
"reset_index",
"(",
"self",
",",
"dims_or_levels",
",",
"drop",
"=",
"False",
",",
"inplace",
"=",
"None",
")",
":",
"inplace",
"=",
"_check_inplace",
"(",
"inplace",
")",
"variables",
",",
"coord_names",
"=",
"split_indexes",
"(",
"dims_or_levels",
"... | Reset the specified index(es) or multi-index level(s).
Parameters
----------
dims_or_levels : str or list
Name(s) of the dimension(s) and/or multi-index level(s) that will
be reset.
drop : bool, optional
If True, remove the specified indexes and/or mu... | [
"Reset",
"the",
"specified",
"index",
"(",
"es",
")",
"or",
"multi",
"-",
"index",
"level",
"(",
"s",
")",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L2515-L2544 | train | Reset the index of the specified dimension or multi - index levels. | 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.reorder_levels | def reorder_levels(self, dim_order=None, inplace=None,
**dim_order_kwargs):
"""Rearrange index levels using input order.
Parameters
----------
dim_order : optional
Mapping from names matching dimensions and values given
by lists representin... | python | def reorder_levels(self, dim_order=None, inplace=None,
**dim_order_kwargs):
"""Rearrange index levels using input order.
Parameters
----------
dim_order : optional
Mapping from names matching dimensions and values given
by lists representin... | [
"def",
"reorder_levels",
"(",
"self",
",",
"dim_order",
"=",
"None",
",",
"inplace",
"=",
"None",
",",
"*",
"*",
"dim_order_kwargs",
")",
":",
"inplace",
"=",
"_check_inplace",
"(",
"inplace",
")",
"dim_order",
"=",
"either_dict_or_kwargs",
"(",
"dim_order",
... | Rearrange index levels using input order.
Parameters
----------
dim_order : optional
Mapping from names matching dimensions and values given
by lists representing new level orders. Every given dimension
must have a multi-index.
inplace : bool, optiona... | [
"Rearrange",
"index",
"levels",
"using",
"input",
"order",
"."
] | 6d93a95d05bdbfc33fff24064f67d29dd891ab58 | https://github.com/pydata/xarray/blob/6d93a95d05bdbfc33fff24064f67d29dd891ab58/xarray/core/dataset.py#L2546-L2582 | train | Rearrange index levels using input order. | 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.