DataArray#
|
N-dimensional array with labeled coordinates and dimensions. |
Attributes#
The array's data converted to numpy.ndarray. |
|
The DataArray's data as an array. |
|
Mapping of |
|
Tuple of dimension names associated with this array. |
|
Ordered mapping from dimension names to lengths. |
|
The name of this array. |
|
Dictionary storing arbitrary metadata with this array. |
|
Dictionary of format-specific settings for how this array should be serialized. |
|
Mapping of pandas.Index objects used for label based indexing. |
|
Mapping of |
|
Mapping from dimension names to block lengths for this dataarray's data. |
ndarray attributes#
Number of array dimensions. |
|
Total bytes consumed by the elements of this DataArray's data. |
|
Tuple of array dimensions. |
|
Number of elements in the array. |
|
Data-type of the array’s elements. |
|
Tuple of block lengths for this dataarray's data, in order of dimensions, or None if the underlying data is not a dask array. |
DataArray contents#
|
Assign new coordinates to this object. |
|
Assign new attrs to this object. |
|
Apply |
|
Returns a new DataArray with renamed coordinates, dimensions or a new name. |
|
Returns a new DataArray with swapped dimensions. |
|
Return a new object with an additional axis (or axes) inserted at the corresponding position in the array shape. |
|
Returns an array with dropped variables. |
|
Drop the indexes assigned to the given coordinates. |
|
Returns a new DataArray with duplicate dimension values removed. |
Return a new DataArray without encoding on the array or any attached coords. |
|
|
Removes all attributes from the DataArray. |
|
Given names of coordinates, reset them to become variables. |
|
Returns a copy of this array. |
|
Convert the DataArray to another calendar. |
|
Interpolates the DataArray to another calendar based on decimal year measure. |
|
Get an index for a dimension, with fall-back to a default RangeIndex |
|
Copy of the xarray object, with data cast to a specified type. |
|
Copy an element of an array to a standard Python scalar and return it. |
Indexing#
|
|
Attribute for location based indexing like pandas. |
|
|
Return a new DataArray whose data is given by selecting indexes along the specified dimension(s). |
|
Return a new DataArray whose data is given by selecting index labels along the specified dimension(s). |
|
Drop index labels from this DataArray. |
|
Drop index positions from this DataArray. |
|
Return a new DataArray whose data is given by the the first n values along the specified dimension(s). |
|
Return a new DataArray whose data is given by the the last n values along the specified dimension(s). |
|
Return a new DataArray whose data is given by each n value along the specified dimension(s). |
|
Return a new object with squeezed data. |
|
Interpolate a DataArray onto new coordinates. |
|
Interpolate this object onto the coordinates of another object, filling out of range values with NaN. |
|
Conform this object onto the indexes of another object, filling in missing values with |
|
Conform this object onto the indexes of another object, for indexes which the objects share. |
|
Set DataArray (multi-)indexes using one or more existing coordinates. |
|
Reset the specified index(es) or multi-index level(s). |
|
Set a new, Xarray-compatible index from one or more existing coordinate(s). |
|
Rearrange index levels using input order. |
|
Return a new data array indexed along the specified dimension(s), where the indexers are given as strings containing Python expressions to be evaluated against the values in the array. |
Missing value handling#
|
Test each value in the array for whether it is a missing value. |
|
Test each value in the array for whether it is not a missing value. |
|
Combine two DataArray objects, with union of coordinates. |
|
Reduce this DataArray's data by applying |
|
Returns a new array with dropped labels for missing values along the provided dimension. |
|
Fill missing values in this object. |
|
Fill NaN values by propagating values forward |
|
Fill NaN values by propagating values backward |
|
Fill in NaNs by interpolating according to different methods. |
|
Filter elements from this object according to a condition. |
|
Tests each value in the array for whether it is in test elements. |
Comparisons#
|
True if two DataArrays have the same dimensions, coordinates and values; otherwise False. |
|
Like equals, but also checks the array name and attributes, and attributes on all coordinates. |
|
Two DataArrays are broadcast equal if they are equal after broadcasting them against each other such that they have the same dimensions. |
Computation#
|
Reduce this array by applying func along some dimension(s). |
|
Returns a DataArrayGroupBy object for performing grouped operations. |
|
Returns a DataArrayGroupBy object for performing grouped operations. |
|
Rolling window object for DataArrays. |
|
Exponentially-weighted moving window. |
|
Accumulating object for DataArrays. |
|
Weighted DataArray operations. |
|
Coarsen object for DataArrays. |
|
Returns a Resample object for performing resampling operations. |
Return axis number(s) corresponding to dimension(s) in this array. |
|
|
Calculate the n-th order discrete difference along given axis. |
|
Perform dot product of two DataArrays along their shared dims. |
|
Compute the qth quantile of the data along the specified dimension. |
|
Differentiate the array with the second order accurate central differences. |
|
Integrate along the given coordinate using the trapezoidal rule. |
|
Least squares polynomial fit. |
|
Apply a function to each block of this DataArray. |
|
Curve fitting optimization for arbitrary functions. |
Aggregation#
|
Reduce this DataArray's data by applying |
|
Reduce this DataArray's data by applying |
|
Index or indices of the maximum of the DataArray over one or more dimensions. |
|
Index or indices of the minimum of the DataArray over one or more dimensions. |
|
Reduce this DataArray's data by applying |
|
Return the coordinate label of the maximum value along a dimension. |
|
Return the coordinate label of the minimum value along a dimension. |
|
Reduce this DataArray's data by applying |
|
Reduce this DataArray's data by applying |
|
Reduce this DataArray's data by applying |
|
Reduce this DataArray's data by applying |
|
Reduce this DataArray's data by applying |
|
Reduce this DataArray's data by applying |
|
Reduce this DataArray's data by applying |
|
Reduce this DataArray's data by applying |
|
Reduce this DataArray's data by applying |
|
Reduce this DataArray's data by applying |
ndarray methods#
|
Returns the indices that would sort this array. |
|
Return an array whose values are limited to |
Complex-conjugate all elements. |
|
|
a.conj() |
The imaginary part of the array. |
|
|
Find indices where elements of v should be inserted in a to maintain order. |
|
|
The real part of the array. |
|
|
Ranks the data. |
String manipulation#
Convert strings in the array to be capitalized. |
|
Convert strings in the array to be casefolded. |
|
|
Concatenate strings elementwise in the DataArray with other strings. |
|
Pad left and right side of each string in the array. |
|
Test if pattern or regex is contained within each string of the array. |
|
Count occurrences of pattern in each string of the array. |
|
Decode character string in the array using indicated encoding. |
|
Encode character string in the array using indicated encoding. |
Test if the end of each string in the array matches a pattern. |
|
|
Extract the first match of capture groups in the regex pat as a new dimension in a DataArray. |
|
Extract all matches of capture groups in the regex pat as new dimensions in a DataArray. |
|
Return lowest or highest indexes in each strings in the array where the substring is fully contained between [start:end]. |
|
Find all occurrences of pattern or regular expression in the DataArray. |
|
Perform python string formatting on each element of the DataArray. |
|
Extract character number i from each string in the array. |
|
Return DataArray of dummy/indicator variables. |
|
Return lowest or highest indexes in each strings where the substring is fully contained between [start:end]. |
Check whether all characters in each string are alphanumeric. |
|
Check whether all characters in each string are alphabetic. |
|
Check whether all characters in each string are decimal. |
|
Check whether all characters in each string are digits. |
|
Check whether all characters in each string are lowercase. |
|
Check whether all characters in each string are numeric. |
|
Check whether all characters in each string are spaces. |
|
Check whether all characters in each string are titlecase. |
|
Check whether all characters in each string are uppercase. |
|
|
Concatenate strings in a DataArray along a particular dimension. |
Compute the length of each string in the array. |
|
|
Pad right side of each string in the array. |
Convert strings in the array to lowercase. |
|
|
Remove leading characters. |
|
Determine if each string in the array matches a regular expression. |
|
Return the Unicode normal form for the strings in the datarray. |
|
Pad strings in the array up to width. |
|
Split the strings in the DataArray at the first occurrence of separator sep. |
|
Repeat each string in the array. |
|
Replace occurrences of pattern/regex in the array with some string. |
|
Return highest indexes in each strings in the array where the substring is fully contained between [start:end]. |
|
Return highest indexes in each strings where the substring is fully contained between [start:end]. |
|
Pad left side of each string in the array. |
|
Split the strings in the DataArray at the last occurrence of separator sep. |
|
Split strings in a DataArray around the given separator/delimiter sep. |
|
Remove trailing characters. |
|
Slice substrings from each string in the array. |
|
Replace a positional slice of a string with another value. |
|
Split strings in a DataArray around the given separator/delimiter sep. |
Test if the start of each string in the array matches a pattern. |
|
|
Remove leading and trailing characters. |
Convert strings in the array to be swapcased. |
|
Convert strings in the array to titlecase. |
|
|
Map characters of each string through the given mapping table. |
Convert strings in the array to uppercase. |
|
|
Wrap long strings in the array in paragraphs with length less than width. |
|
Pad each string in the array by prepending '0' characters. |
Datetimelike properties#
Datetime properties:
The year of the datetime |
|
The month as January=1, December=12 |
|
The days of the datetime |
|
The hours of the datetime |
|
The minutes of the datetime |
|
The seconds of the datetime |
|
The microseconds of the datetime |
|
The nanoseconds of the datetime |
|
The day of the week with Monday=0, Sunday=6 |
|
The day of the week with Monday=0, Sunday=6 |
|
The ordinal day of the year |
|
The quarter of the date |
|
The number of days in the month |
|
The number of days in the month |
|
Each datetime as the year plus the fraction of the year elapsed. |
|
Season of the year |
|
Timestamps corresponding to datetimes |
|
Date corresponding to datetimes |
|
Convert the dates as a fractional year. |
|
The name of the calendar of the dates. |
|
Indicate whether the date is the first day of the month |
|
Indicate whether the date is the last day of the month |
|
Indicate whether the date is the last day of a quarter |
|
Indicate whether the date is the first day of a year |
|
Indicate if the date belongs to a leap year |
Datetime methods:
|
Round timestamps downward to specified frequency resolution. |
|
Round timestamps upward to specified frequency resolution. |
Dataset containing ISO year, week number, and weekday. |
|
|
Round timestamps to specified frequency resolution. |
|
Return an array of formatted strings specified by date_format, which supports the same string format as the python standard library. |
Timedelta properties:
Number of days for each element |
|
Number of seconds (>= 0 and less than 1 day) for each element |
|
Number of microseconds (>= 0 and less than 1 second) for each element |
|
Number of nanoseconds (>= 0 and less than 1 microsecond) for each element |
|
Timedelta methods:
|
Round timestamps downward to specified frequency resolution. |
|
Round timestamps upward to specified frequency resolution. |
|
Round timestamps to specified frequency resolution. |
Reshaping and reorganizing#
|
Return a new DataArray object with transposed dimensions. |
|
Stack any number of existing dimensions into a single new dimension. |
|
Unstack existing dimensions corresponding to MultiIndexes into multiple new dimensions. |
|
Unstack DataArray expanding to Dataset along a given level of a stacked coordinate. |
|
Shift this DataArray by an offset along one or more dimensions. |
|
Roll this array by an offset along one or more dimensions. |
|
Pad this array along one or more dimensions. |
|
Sort object by labels or values (along an axis). |
|
Broadcast this DataArray against another Dataset or DataArray. |