API¶
Xndframes provides one extension type, :class: XndframesArray
class: | String Array |
---|
Methods¶
Various methods that are useful for pandas. When a Series contains a XndframesArray, calling the Series method will dispatch to these methods.
-
XndframesArray.
take
(indices, allow_fill=False, fill_value=None)¶ Take elements from an array.
Parameters: - indices : sequence of integers
Indices to be taken.
- allow_fill : bool, default False
How to handle negative values in indices. * False: negative values in indices indicate position indices
from the right (the default). This is similar to
numpy.take()
.- True: negative values in indices indicate missing values.
These values are set to fill_value. Any other negative values
raise a
ValueError
.
- True: negative values in indices indicate missing values.
These values are set to fill_value. Any other negative values
raise a
- fill_value : any, optional
Fill value to use for NA-indices when allow_fill is True. This may be
None
, in which case the default NA value for the type,self.dtype.na_value
, is used. For many ExtensionArrays, there will be two representations of fill_value: a user-facing “boxed” scalar, and a low-level physical NA value. fill_value should be the user-facing version, and the implementation should handle translating that to the physical version for processing the take if necessary.
Returns: - ExtensionArray
Raises: - IndexError
When the indices are out of bounds for the array.
- ValueError
When indices contain negative values other than
-1
and allow_fill is True.
Notes
ExtensionArray.take is called by
Series.__getitem__
,.loc
,iloc
, when indices is a sequence of values. Additionally, it’s called bySeries.reindex()
, or any other method that causes realignemnt, with a fill_value. See Also ——– numpy.take pandas.api.extensions.take
-
XndframesArray.
unique
()¶ Compute the ExtensionArray of unique values.
Returns: - uniques : ExtensionArray
-
XndframesArray.
isna
()¶ Boolean NumPy array indicating if each value is missing. This should return a 1-D array the same length as ‘self’.