.. _f-weighteddataframe: module ``numbers.weighted_dataframe`` ===================================== .. inheritance-diagram:: cpyquickhelper.numbers.weighted_dataframe Short summary +++++++++++++ module ``cpyquickhelper.numbers.weighted_dataframe`` Addition for :epkg:`pandas`. :githublink:`%|py|0` Classes +++++++ +----------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ | class | truncated documentation | +====================================================================================================+=============================================================================================================================+ | :class:`WeightedArray ` | Implements an array holding @see WeightedDouble numbers. This leverages a new concept introduced in :epkg:`pandas` 0.24 ... | +----------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ | :class:`WeightedDoubleAccessor ` | Extends :epkg:`pandas` with new accessor for series based on @see cl WeightedDouble. | +----------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ | :class:`WeightedSeries ` | Implements a series holding @see WeightedDouble numbers. Does not add anything to *Series*. | +----------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ | :class:`WeightedSeriesDtype ` | Defines a custom type for a @see cl WeightedSeries. | +----------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ Properties ++++++++++ +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | property | truncated documentation | +=====================================================================================================================+==============================================================================================================================+ | :py:meth:`_can_hold_na ` | | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_can_hold_na ` | Can arrays of this dtype hold NA values? | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_constructor ` | | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_constructor_expanddim ` | Used when a manipulation result has one higher dimension as the original, such as Series.to_frame() | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_data ` | | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_hasna ` | Equivalent to `self.isna().any()`. Some ExtensionArray subclasses may be able to optimize this check. | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_info_axis ` | | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_is_boolean ` | Whether this dtype should be considered boolean. By default, ExtensionDtypes are assumed to be non-numeric. ... | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_is_cached ` | Return boolean indicating if self is cached or not. | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_is_mixed_type ` | | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_is_numeric ` | Whether columns with this dtype should be considered numeric. By default ExtensionDtypes are assumed to be non-numeric. ... | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_is_view ` | Return boolean indicating if self is view of another array | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_references ` | | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_stat_axis ` | | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_values ` | Return the internal repr of this data (defined by Block.interval_values). This are the values as stored in the Block ... | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`array ` | The ExtensionArray of the data backing this Series or Index. Returns ------- ExtensionArray An ExtensionArray of the ... | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`at ` | Access a single value for a row/column label pair. Similar to ``loc``, in that both provide label-based lookups. ... | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`attrs ` | Dictionary of global attributes of this dataset. | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`axes ` | Return a list of the row axis labels. | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`dtype ` | Returns @see cl WeightedSeriesDtype. | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`dtype ` | Return the dtype object of the underlying data. Examples -------- >>> s = pd.Series([1, 2, 3]) ... | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`dtypes ` | Return the dtype object of the underlying data. Examples -------- >>> s = pd.Series([1, 2, 3]) ... | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`empty ` | | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`flags ` | Get the properties associated with this pandas object. The available flags are | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`hasnans ` | Return True if there are any NaNs. Enables various performance speedups. Returns ------- ... | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`iat ` | Access a single value for a row/column pair by integer position. Similar to ``iloc``, in that both provide integer-based ... | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`iloc ` | Purely integer-location based indexing for selection by position. ``.iloc[]`` is primarily integer position based ... | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`is_monotonic_decreasing ` | Return boolean if values in the object are monotonically decreasing. Returns ------- bool | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`is_monotonic_increasing ` | Return boolean if values in the object are monotonically increasing. Returns ------- bool | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`is_unique ` | Return boolean if values in the object are unique. Returns ------- bool | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`kind ` | A character code (one of 'biufcmMOSUV'), default 'O' This should match the NumPy dtype used when the array is ... | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`loc ` | Access a group of rows and columns by label(s) or a boolean array. ``.loc[]`` is primarily label based, but may ... | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`na_value ` | Default NA value to use for this type. This is used in e.g. ExtensionArray.take. This should be the user-facing ... | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`name ` | A string identifying the data type. Will be used for display in, e.g. ``Series.dtype`` | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`name ` | Return the name of the Series. The name of a Series becomes its index or column name if it is used to form ... | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`name ` | A string identifying the data type. Will be used for display in, e.g. ``Series.dtype`` | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`names ` | Ordered list of field names, or None if there are no fields. This is for compatibility with NumPy arrays, and may ... | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`nbytes ` | Return the number of bytes in the underlying data. | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`ndim ` | Number of dimensions of the underlying data, by definition 1. | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`shape ` | Return a tuple of the shape of the underlying data. Examples -------- >>> s = pd.Series([1, 2, ... | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`size ` | Return the number of elements in the underlying data. | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`T ` | Return the transpose, which is by definition self. | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`type ` | The scalar type for the array, e.g. ``int`` It's expected ``ExtensionArray[item]`` returns an instance of ... | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`value ` | Returns the values. | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`values ` | Return Series as ndarray or ndarray-like depending on the dtype. | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`weight ` | Returns the weights. | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ Static Methods ++++++++++++++ +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+ | staticmethod | truncated documentation | +=====================================================================================================================+================================================================================================+ | :py:meth:`_concat_same_type ` | Concatenate multiple array Parameters ---------- to_concat : sequence of this type Returns ... | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+ | :py:meth:`_from_sequence ` | | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+ | :meth:`construct_array_type ` | Return the array type associated with this dtype. Returns ------- type | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+ | :meth:`construct_from_string ` | Attempt to construct this type from a string. Parameters ---------- string : str Returns ... | +---------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+ Methods +++++++ +-------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ | method | truncated documentation | +=======================================================================================================+========================================================================================================+ | :py:meth:`__add__ ` | Addition | +-------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ | :py:meth:`__getattr__ ` | Tries first to see if class *Series* has this attribute and then tries @see cl WeightedDoubleAccessor. | +-------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ | :py:meth:`__init__ ` | Overwrites the constructor to force *dtype* to be @see cl WeightedSeriesDtype. | +-------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ | :py:meth:`__init__ ` | | +-------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ | :py:meth:`__init__ ` | Overwrites the constructor to force dtype to be @see cl WeightedSeriesDtype. | +-------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ | :py:meth:`__len__ ` | | +-------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ | :py:meth:`__mul__ ` | Multiplication | +-------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ | :py:meth:`__repr__ ` | usual | +-------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ | :py:meth:`__str__ ` | usual | +-------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ | :py:meth:`__sub__ ` | Soustraction | +-------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ | :py:meth:`__truediv__ ` | Division | +-------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ | :py:meth:`_new_series ` | | +-------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ | :meth:`isna ` | is nan? | +-------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ | :meth:`isnan ` | Tells if values are missing. | +-------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------+ Documentation +++++++++++++ .. automodule:: cpyquickhelper.numbers.weighted_dataframe :members: :special-members: __init__ :show-inheritance: