doc_content stringlengths 1 386k | doc_id stringlengths 5 188 |
|---|---|
pandas.api.extensions.ExtensionDtype.construct_from_string classmethodExtensionDtype.construct_from_string(string)[source]
Construct this type from a string. This is useful mainly for data types that accept parameters. For example, a period dtype accepts a frequency parameter that can be set as period[H] (where H m... | pandas.reference.api.pandas.api.extensions.extensiondtype.construct_from_string |
pandas.api.extensions.ExtensionDtype.empty ExtensionDtype.empty(shape)[source]
Construct an ExtensionArray of this dtype with the given shape. Analogous to numpy.empty. Parameters
shape:int or tuple[int]
Returns
ExtensionArray | pandas.reference.api.pandas.api.extensions.extensiondtype.empty |
pandas.api.extensions.ExtensionDtype.is_dtype classmethodExtensionDtype.is_dtype(dtype)[source]
Check if we match ‘dtype’. Parameters
dtype:object
The object to check. Returns
bool
Notes The default implementation is True if cls.construct_from_string(dtype) is an instance of cls. dtype is an object a... | pandas.reference.api.pandas.api.extensions.extensiondtype.is_dtype |
pandas.api.extensions.ExtensionDtype.kind propertyExtensionDtype.kind
A character code (one of ‘biufcmMOSUV’), default ‘O’ This should match the NumPy dtype used when the array is converted to an ndarray, which is probably ‘O’ for object if the extension type cannot be represented as a built-in NumPy type. See als... | pandas.reference.api.pandas.api.extensions.extensiondtype.kind |
pandas.api.extensions.ExtensionDtype.na_value propertyExtensionDtype.na_value
Default NA value to use for this type. This is used in e.g. ExtensionArray.take. This should be the user-facing “boxed” version of the NA value, not the physical NA value for storage. e.g. for JSONArray, this is an empty dictionary. | pandas.reference.api.pandas.api.extensions.extensiondtype.na_value |
pandas.api.extensions.ExtensionDtype.name propertyExtensionDtype.name
A string identifying the data type. Will be used for display in, e.g. Series.dtype | pandas.reference.api.pandas.api.extensions.extensiondtype.name |
pandas.api.extensions.ExtensionDtype.names propertyExtensionDtype.names
Ordered list of field names, or None if there are no fields. This is for compatibility with NumPy arrays, and may be removed in the future. | pandas.reference.api.pandas.api.extensions.extensiondtype.names |
pandas.api.extensions.ExtensionDtype.type propertyExtensionDtype.type
The scalar type for the array, e.g. int It’s expected ExtensionArray[item] returns an instance of ExtensionDtype.type for scalar item, assuming that value is valid (not NA). NA values do not need to be instances of type. | pandas.reference.api.pandas.api.extensions.extensiondtype.type |
pandas.api.extensions.register_dataframe_accessor pandas.api.extensions.register_dataframe_accessor(name)[source]
Register a custom accessor on DataFrame objects. Parameters
name:str
Name under which the accessor should be registered. A warning is issued if this name conflicts with a preexisting attribute. ... | pandas.reference.api.pandas.api.extensions.register_dataframe_accessor |
pandas.api.extensions.register_extension_dtype pandas.api.extensions.register_extension_dtype(cls)[source]
Register an ExtensionType with pandas as class decorator. This enables operations like .astype(name) for the name of the ExtensionDtype. Returns
callable
A class decorator. Examples
>>> from pandas.ap... | pandas.reference.api.pandas.api.extensions.register_extension_dtype |
pandas.api.extensions.register_index_accessor pandas.api.extensions.register_index_accessor(name)[source]
Register a custom accessor on Index objects. Parameters
name:str
Name under which the accessor should be registered. A warning is issued if this name conflicts with a preexisting attribute. Returns
c... | pandas.reference.api.pandas.api.extensions.register_index_accessor |
pandas.api.extensions.register_series_accessor pandas.api.extensions.register_series_accessor(name)[source]
Register a custom accessor on Series objects. Parameters
name:str
Name under which the accessor should be registered. A warning is issued if this name conflicts with a preexisting attribute. Returns ... | pandas.reference.api.pandas.api.extensions.register_series_accessor |
pandas.api.indexers.BaseIndexer classpandas.api.indexers.BaseIndexer(index_array=None, window_size=0, **kwargs)[source]
Base class for window bounds calculations. Methods
get_window_bounds([num_values, min_periods, ...]) Computes the bounds of a window. | pandas.reference.api.pandas.api.indexers.baseindexer |
pandas.api.indexers.BaseIndexer.get_window_bounds BaseIndexer.get_window_bounds(num_values=0, min_periods=None, center=None, closed=None)[source]
Computes the bounds of a window. Parameters
num_values:int, default 0
number of values that will be aggregated over
window_size:int, default 0
the number of row... | pandas.reference.api.pandas.api.indexers.baseindexer.get_window_bounds |
pandas.api.indexers.check_array_indexer pandas.api.indexers.check_array_indexer(array, indexer)[source]
Check if indexer is a valid array indexer for array. For a boolean mask, array and indexer are checked to have the same length. The dtype is validated, and if it is an integer or boolean ExtensionArray, it is che... | pandas.reference.api.pandas.api.indexers.check_array_indexer |
pandas.api.indexers.FixedForwardWindowIndexer classpandas.api.indexers.FixedForwardWindowIndexer(index_array=None, window_size=0, **kwargs)[source]
Creates window boundaries for fixed-length windows that include the current row. Examples
>>> df = pd.DataFrame({'B': [0, 1, 2, np.nan, 4]})
>>> df
B
0 0.0
1 1.... | pandas.reference.api.pandas.api.indexers.fixedforwardwindowindexer |
pandas.api.indexers.FixedForwardWindowIndexer.get_window_bounds FixedForwardWindowIndexer.get_window_bounds(num_values=0, min_periods=None, center=None, closed=None)[source]
Computes the bounds of a window. Parameters
num_values:int, default 0
number of values that will be aggregated over
window_size:int, d... | pandas.reference.api.pandas.api.indexers.fixedforwardwindowindexer.get_window_bounds |
pandas.api.indexers.VariableOffsetWindowIndexer classpandas.api.indexers.VariableOffsetWindowIndexer(index_array=None, window_size=0, index=None, offset=None, **kwargs)[source]
Calculate window boundaries based on a non-fixed offset such as a BusinessDay. Methods
get_window_bounds([num_values, min_periods, .... | pandas.reference.api.pandas.api.indexers.variableoffsetwindowindexer |
pandas.api.indexers.VariableOffsetWindowIndexer.get_window_bounds VariableOffsetWindowIndexer.get_window_bounds(num_values=0, min_periods=None, center=None, closed=None)[source]
Computes the bounds of a window. Parameters
num_values:int, default 0
number of values that will be aggregated over
window_size:in... | pandas.reference.api.pandas.api.indexers.variableoffsetwindowindexer.get_window_bounds |
pandas.api.types.infer_dtype pandas.api.types.infer_dtype()
Efficiently infer the type of a passed val, or list-like array of values. Return a string describing the type. Parameters
value:scalar, list, ndarray, or pandas type
skipna:bool, default True
Ignore NaN values when inferring the type. Returns
... | pandas.reference.api.pandas.api.types.infer_dtype |
pandas.api.types.is_bool pandas.api.types.is_bool()
Return True if given object is boolean. Returns
bool | pandas.reference.api.pandas.api.types.is_bool |
pandas.api.types.is_bool_dtype pandas.api.types.is_bool_dtype(arr_or_dtype)[source]
Check whether the provided array or dtype is of a boolean dtype. Parameters
arr_or_dtype:array-like or dtype
The array or dtype to check. Returns
boolean
Whether or not the array or dtype is of a boolean dtype. Notes... | pandas.reference.api.pandas.api.types.is_bool_dtype |
pandas.api.types.is_categorical pandas.api.types.is_categorical(arr)[source]
Check whether an array-like is a Categorical instance. Parameters
arr:array-like
The array-like to check. Returns
boolean
Whether or not the array-like is of a Categorical instance. Examples
>>> is_categorical([1, 2, 3])
F... | pandas.reference.api.pandas.api.types.is_categorical |
pandas.api.types.is_categorical_dtype pandas.api.types.is_categorical_dtype(arr_or_dtype)[source]
Check whether an array-like or dtype is of the Categorical dtype. Parameters
arr_or_dtype:array-like or dtype
The array-like or dtype to check. Returns
boolean
Whether or not the array-like or dtype is of t... | pandas.reference.api.pandas.api.types.is_categorical_dtype |
pandas.api.types.is_complex pandas.api.types.is_complex()
Return True if given object is complex. Returns
bool | pandas.reference.api.pandas.api.types.is_complex |
pandas.api.types.is_complex_dtype pandas.api.types.is_complex_dtype(arr_or_dtype)[source]
Check whether the provided array or dtype is of a complex dtype. Parameters
arr_or_dtype:array-like or dtype
The array or dtype to check. Returns
boolean
Whether or not the array or dtype is of a complex dtype. ... | pandas.reference.api.pandas.api.types.is_complex_dtype |
pandas.api.types.is_datetime64_any_dtype pandas.api.types.is_datetime64_any_dtype(arr_or_dtype)[source]
Check whether the provided array or dtype is of the datetime64 dtype. Parameters
arr_or_dtype:array-like or dtype
The array or dtype to check. Returns
bool
Whether or not the array or dtype is of the ... | pandas.reference.api.pandas.api.types.is_datetime64_any_dtype |
pandas.api.types.is_datetime64_dtype pandas.api.types.is_datetime64_dtype(arr_or_dtype)[source]
Check whether an array-like or dtype is of the datetime64 dtype. Parameters
arr_or_dtype:array-like or dtype
The array-like or dtype to check. Returns
boolean
Whether or not the array-like or dtype is of the ... | pandas.reference.api.pandas.api.types.is_datetime64_dtype |
pandas.api.types.is_datetime64_ns_dtype pandas.api.types.is_datetime64_ns_dtype(arr_or_dtype)[source]
Check whether the provided array or dtype is of the datetime64[ns] dtype. Parameters
arr_or_dtype:array-like or dtype
The array or dtype to check. Returns
bool
Whether or not the array or dtype is of th... | pandas.reference.api.pandas.api.types.is_datetime64_ns_dtype |
pandas.api.types.is_datetime64tz_dtype pandas.api.types.is_datetime64tz_dtype(arr_or_dtype)[source]
Check whether an array-like or dtype is of a DatetimeTZDtype dtype. Parameters
arr_or_dtype:array-like or dtype
The array-like or dtype to check. Returns
boolean
Whether or not the array-like or dtype is ... | pandas.reference.api.pandas.api.types.is_datetime64tz_dtype |
pandas.api.types.is_dict_like pandas.api.types.is_dict_like(obj)[source]
Check if the object is dict-like. Parameters
obj:The object to check
Returns
is_dict_like:bool
Whether obj has dict-like properties. Examples
>>> is_dict_like({1: 2})
True
>>> is_dict_like([1, 2, 3])
False
>>> is_dict_like(dic... | pandas.reference.api.pandas.api.types.is_dict_like |
pandas.api.types.is_extension_array_dtype pandas.api.types.is_extension_array_dtype(arr_or_dtype)[source]
Check if an object is a pandas extension array type. See the Use Guide for more. Parameters
arr_or_dtype:object
For array-like input, the .dtype attribute will be extracted. Returns
bool
Whether the... | pandas.reference.api.pandas.api.types.is_extension_array_dtype |
pandas.api.types.is_extension_type pandas.api.types.is_extension_type(arr)[source]
Check whether an array-like is of a pandas extension class instance. Deprecated since version 1.0.0: Use is_extension_array_dtype instead. Extension classes include categoricals, pandas sparse objects (i.e. classes represented with... | pandas.reference.api.pandas.api.types.is_extension_type |
pandas.api.types.is_file_like pandas.api.types.is_file_like(obj)[source]
Check if the object is a file-like object. For objects to be considered file-like, they must be an iterator AND have either a read and/or write method as an attribute. Note: file-like objects must be iterable, but iterable objects need not be ... | pandas.reference.api.pandas.api.types.is_file_like |
pandas.api.types.is_float pandas.api.types.is_float()
Return True if given object is float. Returns
bool | pandas.reference.api.pandas.api.types.is_float |
pandas.api.types.is_float_dtype pandas.api.types.is_float_dtype(arr_or_dtype)[source]
Check whether the provided array or dtype is of a float dtype. This function is internal and should not be exposed in the public API. Parameters
arr_or_dtype:array-like or dtype
The array or dtype to check. Returns
bool... | pandas.reference.api.pandas.api.types.is_float_dtype |
pandas.api.types.is_hashable pandas.api.types.is_hashable(obj)[source]
Return True if hash(obj) will succeed, False otherwise. Some types will pass a test against collections.abc.Hashable but fail when they are actually hashed with hash(). Distinguish between these and other types by trying the call to hash() and s... | pandas.reference.api.pandas.api.types.is_hashable |
pandas.api.types.is_int64_dtype pandas.api.types.is_int64_dtype(arr_or_dtype)[source]
Check whether the provided array or dtype is of the int64 dtype. Parameters
arr_or_dtype:array-like or dtype
The array or dtype to check. Returns
boolean
Whether or not the array or dtype is of the int64 dtype. Not... | pandas.reference.api.pandas.api.types.is_int64_dtype |
pandas.api.types.is_integer pandas.api.types.is_integer()
Return True if given object is integer. Returns
bool | pandas.reference.api.pandas.api.types.is_integer |
pandas.api.types.is_integer_dtype pandas.api.types.is_integer_dtype(arr_or_dtype)[source]
Check whether the provided array or dtype is of an integer dtype. Unlike in is_any_int_dtype, timedelta64 instances will return False. The nullable Integer dtypes (e.g. pandas.Int64Dtype) are also considered as integer by this... | pandas.reference.api.pandas.api.types.is_integer_dtype |
pandas.api.types.is_interval pandas.api.types.is_interval() | pandas.reference.api.pandas.api.types.is_interval |
pandas.api.types.is_interval_dtype pandas.api.types.is_interval_dtype(arr_or_dtype)[source]
Check whether an array-like or dtype is of the Interval dtype. Parameters
arr_or_dtype:array-like or dtype
The array-like or dtype to check. Returns
boolean
Whether or not the array-like or dtype is of the Interv... | pandas.reference.api.pandas.api.types.is_interval_dtype |
pandas.api.types.is_iterator pandas.api.types.is_iterator()
Check if the object is an iterator. This is intended for generators, not list-like objects. Parameters
obj:The object to check
Returns
is_iter:bool
Whether obj is an iterator. Examples
>>> import datetime
>>> is_iterator((x for x in []))
T... | pandas.reference.api.pandas.api.types.is_iterator |
pandas.api.types.is_list_like pandas.api.types.is_list_like()
Check if the object is list-like. Objects that are considered list-like are for example Python lists, tuples, sets, NumPy arrays, and Pandas Series. Strings and datetime objects, however, are not considered list-like. Parameters
obj:object
Object t... | pandas.reference.api.pandas.api.types.is_list_like |
pandas.api.types.is_named_tuple pandas.api.types.is_named_tuple(obj)[source]
Check if the object is a named tuple. Parameters
obj:The object to check
Returns
is_named_tuple:bool
Whether obj is a named tuple. Examples
>>> from collections import namedtuple
>>> Point = namedtuple("Point", ["x", "y"])... | pandas.reference.api.pandas.api.types.is_named_tuple |
pandas.api.types.is_number pandas.api.types.is_number(obj)[source]
Check if the object is a number. Returns True when the object is a number, and False if is not. Parameters
obj:any type
The object to check if is a number. Returns
is_number:bool
Whether obj is a number or not. See also api.types... | pandas.reference.api.pandas.api.types.is_number |
pandas.api.types.is_numeric_dtype pandas.api.types.is_numeric_dtype(arr_or_dtype)[source]
Check whether the provided array or dtype is of a numeric dtype. Parameters
arr_or_dtype:array-like or dtype
The array or dtype to check. Returns
boolean
Whether or not the array or dtype is of a numeric dtype. ... | pandas.reference.api.pandas.api.types.is_numeric_dtype |
pandas.api.types.is_object_dtype pandas.api.types.is_object_dtype(arr_or_dtype)[source]
Check whether an array-like or dtype is of the object dtype. Parameters
arr_or_dtype:array-like or dtype
The array-like or dtype to check. Returns
boolean
Whether or not the array-like or dtype is of the object dtype... | pandas.reference.api.pandas.api.types.is_object_dtype |
pandas.api.types.is_period_dtype pandas.api.types.is_period_dtype(arr_or_dtype)[source]
Check whether an array-like or dtype is of the Period dtype. Parameters
arr_or_dtype:array-like or dtype
The array-like or dtype to check. Returns
boolean
Whether or not the array-like or dtype is of the Period dtype... | pandas.reference.api.pandas.api.types.is_period_dtype |
pandas.api.types.is_re pandas.api.types.is_re(obj)[source]
Check if the object is a regex pattern instance. Parameters
obj:The object to check
Returns
is_regex:bool
Whether obj is a regex pattern. Examples
>>> is_re(re.compile(".*"))
True
>>> is_re("foo")
False | pandas.reference.api.pandas.api.types.is_re |
pandas.api.types.is_re_compilable pandas.api.types.is_re_compilable(obj)[source]
Check if the object can be compiled into a regex pattern instance. Parameters
obj:The object to check
Returns
is_regex_compilable:bool
Whether obj can be compiled as a regex pattern. Examples
>>> is_re_compilable(".*")... | pandas.reference.api.pandas.api.types.is_re_compilable |
pandas.api.types.is_scalar pandas.api.types.is_scalar()
Return True if given object is scalar. Parameters
val:object
This includes: numpy array scalar (e.g. np.int64) Python builtin numerics Python builtin byte arrays and strings None datetime.datetime datetime.timedelta Period decimal.Decimal Interval DateO... | pandas.reference.api.pandas.api.types.is_scalar |
pandas.api.types.is_signed_integer_dtype pandas.api.types.is_signed_integer_dtype(arr_or_dtype)[source]
Check whether the provided array or dtype is of a signed integer dtype. Unlike in is_any_int_dtype, timedelta64 instances will return False. The nullable Integer dtypes (e.g. pandas.Int64Dtype) are also considere... | pandas.reference.api.pandas.api.types.is_signed_integer_dtype |
pandas.api.types.is_sparse pandas.api.types.is_sparse(arr)[source]
Check whether an array-like is a 1-D pandas sparse array. Check that the one-dimensional array-like is a pandas sparse array. Returns True if it is a pandas sparse array, not another type of sparse array. Parameters
arr:array-like
Array-like t... | pandas.reference.api.pandas.api.types.is_sparse |
pandas.api.types.is_string_dtype pandas.api.types.is_string_dtype(arr_or_dtype)[source]
Check whether the provided array or dtype is of the string dtype. Parameters
arr_or_dtype:array-like or dtype
The array or dtype to check. Returns
boolean
Whether or not the array or dtype is of the string dtype. ... | pandas.reference.api.pandas.api.types.is_string_dtype |
pandas.api.types.is_timedelta64_dtype pandas.api.types.is_timedelta64_dtype(arr_or_dtype)[source]
Check whether an array-like or dtype is of the timedelta64 dtype. Parameters
arr_or_dtype:array-like or dtype
The array-like or dtype to check. Returns
boolean
Whether or not the array-like or dtype is of t... | pandas.reference.api.pandas.api.types.is_timedelta64_dtype |
pandas.api.types.is_timedelta64_ns_dtype pandas.api.types.is_timedelta64_ns_dtype(arr_or_dtype)[source]
Check whether the provided array or dtype is of the timedelta64[ns] dtype. This is a very specific dtype, so generic ones like np.timedelta64 will return False if passed into this function. Parameters
arr_or_... | pandas.reference.api.pandas.api.types.is_timedelta64_ns_dtype |
pandas.api.types.is_unsigned_integer_dtype pandas.api.types.is_unsigned_integer_dtype(arr_or_dtype)[source]
Check whether the provided array or dtype is of an unsigned integer dtype. The nullable Integer dtypes (e.g. pandas.UInt64Dtype) are also considered as integer by this function. Parameters
arr_or_dtype:ar... | pandas.reference.api.pandas.api.types.is_unsigned_integer_dtype |
pandas.api.types.pandas_dtype pandas.api.types.pandas_dtype(dtype)[source]
Convert input into a pandas only dtype object or a numpy dtype object. Parameters
dtype:object to be converted
Returns
np.dtype or a pandas dtype
Raises
TypeError if not a dtype | pandas.reference.api.pandas.api.types.pandas_dtype |
pandas.api.types.union_categoricals pandas.api.types.union_categoricals(to_union, sort_categories=False, ignore_order=False)[source]
Combine list-like of Categorical-like, unioning categories. All categories must have the same dtype. Parameters
to_union:list-like
Categorical, CategoricalIndex, or Series with ... | pandas.reference.api.pandas.api.types.union_categoricals |
pandas.array pandas.array(data, dtype=None, copy=True)[source]
Create an array. Parameters
data:Sequence of objects
The scalars inside data should be instances of the scalar type for dtype. It’s expected that data represents a 1-dimensional array of data. When data is an Index or Series, the underlying array ... | pandas.reference.api.pandas.array |
pandas.arrays.ArrowStringArray classpandas.arrays.ArrowStringArray(values)[source]
Extension array for string data in a pyarrow.ChunkedArray. New in version 1.2.0. Warning ArrowStringArray is considered experimental. The implementation and parts of the API may change without warning. Parameters
values:pyarr... | pandas.reference.api.pandas.arrays.arrowstringarray |
pandas.arrays.BooleanArray classpandas.arrays.BooleanArray(values, mask, copy=False)[source]
Array of boolean (True/False) data with missing values. This is a pandas Extension array for boolean data, under the hood represented by 2 numpy arrays: a boolean array with the data and a boolean array with the mask (True ... | pandas.reference.api.pandas.arrays.booleanarray |
pandas.arrays.DatetimeArray classpandas.arrays.DatetimeArray(values, dtype=dtype('<M8[ns]'), freq=None, copy=False)[source]
Pandas ExtensionArray for tz-naive or tz-aware datetime data. Warning DatetimeArray is currently experimental, and its API may change without warning. In particular, DatetimeArray.dtype is ex... | pandas.reference.api.pandas.arrays.datetimearray |
pandas.arrays.IntegerArray classpandas.arrays.IntegerArray(values, mask, copy=False)[source]
Array of integer (optional missing) values. Changed in version 1.0.0: Now uses pandas.NA as the missing value rather than numpy.nan. Warning IntegerArray is currently experimental, and its API or internal implementation ... | pandas.reference.api.pandas.arrays.integerarray |
pandas.arrays.IntervalArray classpandas.arrays.IntervalArray(data, closed=None, dtype=None, copy=False, verify_integrity=True)[source]
Pandas array for interval data that are closed on the same side. New in version 0.24.0. Parameters
data:array-like (1-dimensional)
Array-like containing Interval objects fro... | pandas.reference.api.pandas.arrays.intervalarray |
pandas.arrays.IntervalArray.closed propertyIntervalArray.closed
Whether the intervals are closed on the left-side, right-side, both or neither. | pandas.reference.api.pandas.arrays.intervalarray.closed |
pandas.arrays.IntervalArray.contains IntervalArray.contains(other)[source]
Check elementwise if the Intervals contain the value. Return a boolean mask whether the value is contained in the Intervals of the IntervalArray. New in version 0.25.0. Parameters
other:scalar
The value to check whether it is contain... | pandas.reference.api.pandas.arrays.intervalarray.contains |
pandas.arrays.IntervalArray.from_arrays classmethodIntervalArray.from_arrays(left, right, closed='right', copy=False, dtype=None)[source]
Construct from two arrays defining the left and right bounds. Parameters
left:array-like (1-dimensional)
Left bounds for each interval.
right:array-like (1-dimensional)
... | pandas.reference.api.pandas.arrays.intervalarray.from_arrays |
pandas.arrays.IntervalArray.from_breaks classmethodIntervalArray.from_breaks(breaks, closed='right', copy=False, dtype=None)[source]
Construct an IntervalArray from an array of splits. Parameters
breaks:array-like (1-dimensional)
Left and right bounds for each interval.
closed:{‘left’, ‘right’, ‘both’, ‘nei... | pandas.reference.api.pandas.arrays.intervalarray.from_breaks |
pandas.arrays.IntervalArray.from_tuples classmethodIntervalArray.from_tuples(data, closed='right', copy=False, dtype=None)[source]
Construct an IntervalArray from an array-like of tuples. Parameters
data:array-like (1-dimensional)
Array of tuples.
closed:{‘left’, ‘right’, ‘both’, ‘neither’}, default ‘right’... | pandas.reference.api.pandas.arrays.intervalarray.from_tuples |
pandas.arrays.IntervalArray.is_empty IntervalArray.is_empty
Indicates if an interval is empty, meaning it contains no points. New in version 0.25.0. Returns
bool or ndarray
A boolean indicating if a scalar Interval is empty, or a boolean ndarray positionally indicating if an Interval in an IntervalArray or In... | pandas.reference.api.pandas.arrays.intervalarray.is_empty |
pandas.arrays.IntervalArray.is_non_overlapping_monotonic propertyIntervalArray.is_non_overlapping_monotonic
Return True if the IntervalArray is non-overlapping (no Intervals share points) and is either monotonic increasing or monotonic decreasing, else False. | pandas.reference.api.pandas.arrays.intervalarray.is_non_overlapping_monotonic |
pandas.arrays.IntervalArray.left propertyIntervalArray.left
Return the left endpoints of each Interval in the IntervalArray as an Index. | pandas.reference.api.pandas.arrays.intervalarray.left |
pandas.arrays.IntervalArray.length propertyIntervalArray.length
Return an Index with entries denoting the length of each Interval in the IntervalArray. | pandas.reference.api.pandas.arrays.intervalarray.length |
pandas.arrays.IntervalArray.mid propertyIntervalArray.mid
Return the midpoint of each Interval in the IntervalArray as an Index. | pandas.reference.api.pandas.arrays.intervalarray.mid |
pandas.arrays.IntervalArray.overlaps IntervalArray.overlaps(other)[source]
Check elementwise if an Interval overlaps the values in the IntervalArray. Two intervals overlap if they share a common point, including closed endpoints. Intervals that only have an open endpoint in common do not overlap. Parameters
oth... | pandas.reference.api.pandas.arrays.intervalarray.overlaps |
pandas.arrays.IntervalArray.right propertyIntervalArray.right
Return the right endpoints of each Interval in the IntervalArray as an Index. | pandas.reference.api.pandas.arrays.intervalarray.right |
pandas.arrays.IntervalArray.set_closed IntervalArray.set_closed(closed)[source]
Return an IntervalArray identical to the current one, but closed on the specified side. Parameters
closed:{‘left’, ‘right’, ‘both’, ‘neither’}
Whether the intervals are closed on the left-side, right-side, both or neither. Retu... | pandas.reference.api.pandas.arrays.intervalarray.set_closed |
pandas.arrays.IntervalArray.to_tuples IntervalArray.to_tuples(na_tuple=True)[source]
Return an ndarray of tuples of the form (left, right). Parameters
na_tuple:bool, default True
Returns NA as a tuple if True, (nan, nan), or just as the NA value itself if False, nan. Returns
tuples: ndarray | pandas.reference.api.pandas.arrays.intervalarray.to_tuples |
pandas.arrays.PandasArray classpandas.arrays.PandasArray(values, copy=False)[source]
A pandas ExtensionArray for NumPy data. This is mostly for internal compatibility, and is not especially useful on its own. Parameters
values:ndarray
The NumPy ndarray to wrap. Must be 1-dimensional.
copy:bool, default Fals... | pandas.reference.api.pandas.arrays.pandasarray |
pandas.arrays.PeriodArray classpandas.arrays.PeriodArray(values, dtype=None, freq=None, copy=False)[source]
Pandas ExtensionArray for storing Period data. Users should use period_array() to create new instances. Alternatively, array() can be used to create new instances from a sequence of Period scalars. Parameter... | pandas.reference.api.pandas.arrays.periodarray |
pandas.arrays.SparseArray classpandas.arrays.SparseArray(data, sparse_index=None, index=None, fill_value=None, kind='integer', dtype=None, copy=False)[source]
An ExtensionArray for storing sparse data. Parameters
data:array-like or scalar
A dense array of values to store in the SparseArray. This may contain f... | pandas.reference.api.pandas.arrays.sparsearray |
pandas.arrays.StringArray classpandas.arrays.StringArray(values, copy=False)[source]
Extension array for string data. New in version 1.0.0. Warning StringArray is considered experimental. The implementation and parts of the API may change without warning. Parameters
values:array-like
The array of data. W... | pandas.reference.api.pandas.arrays.stringarray |
pandas.arrays.TimedeltaArray classpandas.arrays.TimedeltaArray(values, dtype=dtype('<m8[ns]'), freq=NoDefault.no_default, copy=False)[source]
Pandas ExtensionArray for timedelta data. Warning TimedeltaArray is currently experimental, and its API may change without warning. In particular, TimedeltaArray.dtype is ex... | pandas.reference.api.pandas.arrays.timedeltaarray |
pandas.bdate_range pandas.bdate_range(start=None, end=None, periods=None, freq='B', tz=None, normalize=True, name=None, weekmask=None, holidays=None, closed=NoDefault.no_default, inclusive=None, **kwargs)[source]
Return a fixed frequency DatetimeIndex, with business day as the default frequency. Parameters
star... | pandas.reference.api.pandas.bdate_range |
pandas.BooleanDtype classpandas.BooleanDtype[source]
Extension dtype for boolean data. New in version 1.0.0. Warning BooleanDtype is considered experimental. The implementation and parts of the API may change without warning. Examples
>>> pd.BooleanDtype()
BooleanDtype
Attributes
None Methods ... | pandas.reference.api.pandas.booleandtype |
pandas.Categorical classpandas.Categorical(values, categories=None, ordered=None, dtype=None, fastpath=False, copy=True)[source]
Represent a categorical variable in classic R / S-plus fashion. Categoricals can only take on only a limited, and usually fixed, number of possible values (categories). In contrast to sta... | pandas.reference.api.pandas.categorical |
pandas.Categorical.__array__ Categorical.__array__(dtype=None)[source]
The numpy array interface. Returns
numpy.array
A numpy array of either the specified dtype or, if dtype==None (default), the same dtype as categorical.categories.dtype. | pandas.reference.api.pandas.categorical.__array__ |
pandas.Categorical.categories propertyCategorical.categories
The categories of this categorical. Setting assigns new values to each category (effectively a rename of each individual category). The assigned value has to be a list-like object. All items must be unique and the number of items in the new categories mus... | pandas.reference.api.pandas.categorical.categories |
pandas.Categorical.codes propertyCategorical.codes
The category codes of this categorical. Codes are an array of integers which are the positions of the actual values in the categories array. There is no setter, use the other categorical methods and the normal item setter to change values in the categorical. Retur... | pandas.reference.api.pandas.categorical.codes |
pandas.Categorical.dtype propertyCategorical.dtype
The CategoricalDtype for this instance. | pandas.reference.api.pandas.categorical.dtype |
pandas.Categorical.from_codes classmethodCategorical.from_codes(codes, categories=None, ordered=None, dtype=None)[source]
Make a Categorical type from codes and categories or dtype. This constructor is useful if you already have codes and categories/dtype and so do not need the (computation intensive) factorization... | pandas.reference.api.pandas.categorical.from_codes |
pandas.Categorical.ordered propertyCategorical.ordered
Whether the categories have an ordered relationship. | pandas.reference.api.pandas.categorical.ordered |
pandas.CategoricalDtype classpandas.CategoricalDtype(categories=None, ordered=False)[source]
Type for categorical data with the categories and orderedness. Parameters
categories:sequence, optional
Must be unique, and must not contain any nulls. The categories are stored in an Index, and if an index is provide... | pandas.reference.api.pandas.categoricaldtype |
pandas.CategoricalDtype.categories propertyCategoricalDtype.categories
An Index containing the unique categories allowed. | pandas.reference.api.pandas.categoricaldtype.categories |
pandas.CategoricalDtype.ordered propertyCategoricalDtype.ordered
Whether the categories have an ordered relationship. | pandas.reference.api.pandas.categoricaldtype.ordered |
pandas.CategoricalIndex classpandas.CategoricalIndex(data=None, categories=None, ordered=None, dtype=None, copy=False, name=None)[source]
Index based on an underlying Categorical. CategoricalIndex, like Categorical, can only take on a limited, and usually fixed, number of possible values (categories). Also, like Ca... | pandas.reference.api.pandas.categoricalindex |
pandas.CategoricalIndex.add_categories CategoricalIndex.add_categories(*args, **kwargs)[source]
Add new categories. new_categories will be included at the last/highest place in the categories and will be unused directly after this call. Parameters
new_categories:category or list-like of category
The new categ... | pandas.reference.api.pandas.categoricalindex.add_categories |
pandas.CategoricalIndex.as_ordered CategoricalIndex.as_ordered(*args, **kwargs)[source]
Set the Categorical to be ordered. Parameters
inplace:bool, default False
Whether or not to set the ordered attribute in-place or return a copy of this categorical with ordered set to True. Returns
Categorical or None... | pandas.reference.api.pandas.categoricalindex.as_ordered |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.