neulab/docprompting-conala huggingface dataset:
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 expected to change to be an instance of an ExtensionDtype subclass.   Parameters 
 
values:array-like


The timedelta data.  
dtype:numpy.dtype


Currently, only numpy.dtype("timedelta64[ns]") is accepted.  
freq:Offset, optional


copy:bool, default False


Whether to copy the underlying array of data.     Attributes       
None     Methods       
None
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 
 
start:str or datetime-like, default None


Left bound for generating dates.  
end:str or datetime-like, default None


Right bound for generating dates.  
periods:int, default None


Number of periods to generate.  
freq:str or DateOffset, default ‘B’ (business daily)


Frequency strings can have multiples, e.g. ‘5H’.  
tz:str or None


Time zone name for returning localized DatetimeIndex, for example Asia/Beijing.  
normalize:bool, default False


Normalize start/end dates to midnight before generating date range.  
name:str, default None


Name of the resulting DatetimeIndex.  
weekmask:str or None, default None


Weekmask of valid business days, passed to numpy.busdaycalendar, only used when custom frequency strings are passed. The default value None is equivalent to ‘Mon Tue Wed Thu Fri’.  
holidays:list-like or None, default None


Dates to exclude from the set of valid business days, passed to numpy.busdaycalendar, only used when custom frequency strings are passed.  
closed:str, default None


Make the interval closed with respect to the given frequency to the ‘left’, ‘right’, or both sides (None).  Deprecated since version 1.4.0: Argument closed has been deprecated to standardize boundary inputs. Use inclusive instead, to set each bound as closed or open.   
inclusive:{“both”, “neither”, “left”, “right”}, default “both”


Include boundaries; Whether to set each bound as closed or open.  New in version 1.4.0.   **kwargs

For compatibility. Has no effect on the result.    Returns 
 DatetimeIndex
   Notes Of the four parameters: start, end, periods, and freq, exactly three must be specified. Specifying freq is a requirement for bdate_range. Use date_range if specifying freq is not desired. To learn more about the frequency strings, please see this link. Examples Note how the two weekend days are skipped in the result. 
>>> pd.bdate_range(start='1/1/2018', end='1/08/2018')
DatetimeIndex(['2018-01-01', '2018-01-02', '2018-01-03', '2018-01-04',
           '2018-01-05', '2018-01-08'],
          dtype='datetime64[ns]', freq='B')
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       
None
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 statistical categorical variables, a Categorical might have an order, but numerical operations (additions, divisions, …) are not possible. All values of the Categorical are either in categories or np.nan. Assigning values outside of categories will raise a ValueError. Order is defined by the order of the categories, not lexical order of the values.  Parameters 
 
values:list-like


The values of the categorical. If categories are given, values not in categories will be replaced with NaN.  
categories:Index-like (unique), optional


The unique categories for this categorical. If not given, the categories are assumed to be the unique values of values (sorted, if possible, otherwise in the order in which they appear).  
ordered:bool, default False


Whether or not this categorical is treated as a ordered categorical. If True, the resulting categorical will be ordered. An ordered categorical respects, when sorted, the order of its categories attribute (which in turn is the categories argument, if provided).  
dtype:CategoricalDtype


An instance of CategoricalDtype to use for this categorical.    Raises 
 ValueError

If the categories do not validate.  TypeError

If an explicit ordered=True is given but no categories and the values are not sortable.      See also  CategoricalDtype

Type for categorical data.  CategoricalIndex

An Index with an underlying Categorical.    Notes See the user guide for more. Examples 
>>> pd.Categorical([1, 2, 3, 1, 2, 3])
[1, 2, 3, 1, 2, 3]
Categories (3, int64): [1, 2, 3]
  
>>> pd.Categorical(['a', 'b', 'c', 'a', 'b', 'c'])
['a', 'b', 'c', 'a', 'b', 'c']
Categories (3, object): ['a', 'b', 'c']
  Missing values are not included as a category. 
>>> c = pd.Categorical([1, 2, 3, 1, 2, 3, np.nan])
>>> c
[1, 2, 3, 1, 2, 3, NaN]
Categories (3, int64): [1, 2, 3]
  However, their presence is indicated in the codes attribute by code -1. 
>>> c.codes
array([ 0,  1,  2,  0,  1,  2, -1], dtype=int8)
  Ordered Categoricals can be sorted according to the custom order of the categories and can have a min and max value. 
>>> c = pd.Categorical(['a', 'b', 'c', 'a', 'b', 'c'], ordered=True,
...                    categories=['c', 'b', 'a'])
>>> c
['a', 'b', 'c', 'a', 'b', 'c']
Categories (3, object): ['c' < 'b' < 'a']
>>> c.min()
'c'
  Attributes       
categories The categories of this categorical.  
codes The category codes of this categorical.  
ordered Whether the categories have an ordered relationship.  
dtype The CategoricalDtype for this instance.    Methods       
from_codes(codes[, categories, ordered, dtype]) Make a Categorical type from codes and categories or dtype.  
__array__([dtype]) The numpy array interface.
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.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 must be the same as the number of items in the old categories. Assigning to categories is a inplace operation!  Raises 
 ValueError

If the new categories do not validate as categories or if the number of new categories is unequal the number of old categories      See also  rename_categories

Rename categories.  reorder_categories

Reorder categories.  add_categories

Add new categories.  remove_categories

Remove the specified categories.  remove_unused_categories

Remove categories which are not used.  set_categories

Set the categories to the specified ones.
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.  Returns 
 ndarray[int]

A non-writable view of the codes array.
pandas.Categorical.dtype   propertyCategorical.dtype
 
The CategoricalDtype for this instance.
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 step, which is usually done on the constructor. If your data does not follow this convention, please use the normal constructor.  Parameters 
 
codes:array-like of int


An integer array, where each integer points to a category in categories or dtype.categories, or else is -1 for NaN.  
categories:index-like, optional


The categories for the categorical. Items need to be unique. If the categories are not given here, then they must be provided in dtype.  
ordered:bool, optional


Whether or not this categorical is treated as an ordered categorical. If not given here or in dtype, the resulting categorical will be unordered.  
dtype:CategoricalDtype or “category”, optional


If CategoricalDtype, cannot be used together with categories or ordered.    Returns 
 Categorical
   Examples 
>>> dtype = pd.CategoricalDtype(['a', 'b'], ordered=True)
>>> pd.Categorical.from_codes(codes=[0, 1, 0, 1], dtype=dtype)
['a', 'b', 'a', 'b']
Categories (2, object): ['a' < 'b']
pandas.Categorical.ordered   propertyCategorical.ordered
 
Whether the categories have an ordered relationship.
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 provided the dtype of that index will be used.  
ordered:bool or None, default False


Whether or not this categorical is treated as a ordered categorical. None can be used to maintain the ordered value of existing categoricals when used in operations that combine categoricals, e.g. astype, and will resolve to False if there is no existing ordered to maintain.      See also  Categorical

Represent a categorical variable in classic R / S-plus fashion.    Notes This class is useful for specifying the type of a Categorical independent of the values. See CategoricalDtype for more. Examples 
>>> t = pd.CategoricalDtype(categories=['b', 'a'], ordered=True)
>>> pd.Series(['a', 'b', 'a', 'c'], dtype=t)
0      a
1      b
2      a
3    NaN
dtype: category
Categories (2, object): ['b' < 'a']
  An empty CategoricalDtype with a specific dtype can be created by providing an empty index. As follows, 
>>> pd.CategoricalDtype(pd.DatetimeIndex([])).categories.dtype
dtype('<M8[ns]')
  Attributes       
categories An Index containing the unique categories allowed.  
ordered Whether the categories have an ordered relationship.    Methods       
None
pandas.CategoricalDtype.categories   propertyCategoricalDtype.categories
 
An Index containing the unique categories allowed.
pandas.CategoricalDtype.ordered   propertyCategoricalDtype.ordered
 
Whether the categories have an ordered relationship.
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 Categorical, it might have an order, but numerical operations (additions, divisions, …) are not possible.  Parameters 
 
data:array-like (1-dimensional)


The values of the categorical. If categories are given, values not in categories will be replaced with NaN.  
categories:index-like, optional


The categories for the categorical. Items need to be unique. If the categories are not given here (and also not in dtype), they will be inferred from the data.  
ordered:bool, optional


Whether or not this categorical is treated as an ordered categorical. If not given here or in dtype, the resulting categorical will be unordered.  
dtype:CategoricalDtype or “category”, optional


If CategoricalDtype, cannot be used together with categories or ordered.  
copy:bool, default False


Make a copy of input ndarray.  
name:object, optional


Name to be stored in the index.    Raises 
 ValueError

If the categories do not validate.  TypeError

If an explicit ordered=True is given but no categories and the values are not sortable.      See also  Index

The base pandas Index type.  Categorical

A categorical array.  CategoricalDtype

Type for categorical data.    Notes See the user guide for more. Examples 
>>> pd.CategoricalIndex(["a", "b", "c", "a", "b", "c"])
CategoricalIndex(['a', 'b', 'c', 'a', 'b', 'c'],
                 categories=['a', 'b', 'c'], ordered=False, dtype='category')
  CategoricalIndex can also be instantiated from a Categorical: 
>>> c = pd.Categorical(["a", "b", "c", "a", "b", "c"])
>>> pd.CategoricalIndex(c)
CategoricalIndex(['a', 'b', 'c', 'a', 'b', 'c'],
                 categories=['a', 'b', 'c'], ordered=False, dtype='category')
  Ordered CategoricalIndex can have a min and max value. 
>>> ci = pd.CategoricalIndex(
...     ["a", "b", "c", "a", "b", "c"], ordered=True, categories=["c", "b", "a"]
... )
>>> ci
CategoricalIndex(['a', 'b', 'c', 'a', 'b', 'c'],
                 categories=['c', 'b', 'a'], ordered=True, dtype='category')
>>> ci.min()
'c'
  Attributes       
codes The category codes of this categorical.  
categories The categories of this categorical.  
ordered Whether the categories have an ordered relationship.    Methods       
rename_categories(*args, **kwargs) Rename categories.  
reorder_categories(*args, **kwargs) Reorder categories as specified in new_categories.  
add_categories(*args, **kwargs) Add new categories.  
remove_categories(*args, **kwargs) Remove the specified categories.  
remove_unused_categories(*args, **kwargs) Remove categories which are not used.  
set_categories(*args, **kwargs) Set the categories to the specified new_categories.  
as_ordered(*args, **kwargs) Set the Categorical to be ordered.  
as_unordered(*args, **kwargs) Set the Categorical to be unordered.  
map(mapper) Map values using input an input mapping or function.
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 categories to be included.  
inplace:bool, default False


Whether or not to add the categories inplace or return a copy of this categorical with added categories.  Deprecated since version 1.3.0.     Returns 
 
cat:Categorical or None


Categorical with new categories added or None if inplace=True.    Raises 
 ValueError

If the new categories include old categories or do not validate as categories      See also  rename_categories

Rename categories.  reorder_categories

Reorder categories.  remove_categories

Remove the specified categories.  remove_unused_categories

Remove categories which are not used.  set_categories

Set the categories to the specified ones.    Examples 
>>> c = pd.Categorical(['c', 'b', 'c'])
>>> c
['c', 'b', 'c']
Categories (2, object): ['b', 'c']
  
>>> c.add_categories(['d', 'a'])
['c', 'b', 'c']
Categories (4, object): ['b', 'c', 'd', 'a']
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

Ordered Categorical or None if inplace=True.
pandas.CategoricalIndex.as_unordered   CategoricalIndex.as_unordered(*args, **kwargs)[source]
 
Set the Categorical to be unordered.  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 False.    Returns 
 Categorical or None

Unordered Categorical or None if inplace=True.
pandas.CategoricalIndex.categories   propertyCategoricalIndex.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 must be the same as the number of items in the old categories. Assigning to categories is a inplace operation!  Raises 
 ValueError

If the new categories do not validate as categories or if the number of new categories is unequal the number of old categories      See also  rename_categories

Rename categories.  reorder_categories

Reorder categories.  add_categories

Add new categories.  remove_categories

Remove the specified categories.  remove_unused_categories

Remove categories which are not used.  set_categories

Set the categories to the specified ones.
pandas.CategoricalIndex.codes   propertyCategoricalIndex.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.  Returns 
 ndarray[int]

A non-writable view of the codes array.
pandas.CategoricalIndex.equals   CategoricalIndex.equals(other)[source]
 
Determine if two CategoricalIndex objects contain the same elements.  Returns 
 bool

If two CategoricalIndex objects have equal elements True, otherwise False.
pandas.CategoricalIndex.map   CategoricalIndex.map(mapper)[source]
 
Map values using input an input mapping or function. Maps the values (their categories, not the codes) of the index to new categories. If the mapping correspondence is one-to-one the result is a CategoricalIndex which has the same order property as the original, otherwise an Index is returned. If a dict or Series is used any unmapped category is mapped to NaN. Note that if this happens an Index will be returned.  Parameters 
 
mapper:function, dict, or Series


Mapping correspondence.    Returns 
 pandas.CategoricalIndex or pandas.Index

Mapped index.      See also  Index.map

Apply a mapping correspondence on an Index.  Series.map

Apply a mapping correspondence on a Series.  Series.apply

Apply more complex functions on a Series.    Examples 
>>> idx = pd.CategoricalIndex(['a', 'b', 'c'])
>>> idx
CategoricalIndex(['a', 'b', 'c'], categories=['a', 'b', 'c'],
                  ordered=False, dtype='category')
>>> idx.map(lambda x: x.upper())
CategoricalIndex(['A', 'B', 'C'], categories=['A', 'B', 'C'],
                 ordered=False, dtype='category')
>>> idx.map({'a': 'first', 'b': 'second', 'c': 'third'})
CategoricalIndex(['first', 'second', 'third'], categories=['first',
                 'second', 'third'], ordered=False, dtype='category')
  If the mapping is one-to-one the ordering of the categories is preserved: 
>>> idx = pd.CategoricalIndex(['a', 'b', 'c'], ordered=True)
>>> idx
CategoricalIndex(['a', 'b', 'c'], categories=['a', 'b', 'c'],
                 ordered=True, dtype='category')
>>> idx.map({'a': 3, 'b': 2, 'c': 1})
CategoricalIndex([3, 2, 1], categories=[3, 2, 1], ordered=True,
                 dtype='category')
  If the mapping is not one-to-one an Index is returned: 
>>> idx.map({'a': 'first', 'b': 'second', 'c': 'first'})
Index(['first', 'second', 'first'], dtype='object')
  If a dict is used, all unmapped categories are mapped to NaN and the result is an Index: 
>>> idx.map({'a': 'first', 'b': 'second'})
Index(['first', 'second', nan], dtype='object')
pandas.CategoricalIndex.ordered   propertyCategoricalIndex.ordered
 
Whether the categories have an ordered relationship.
pandas.CategoricalIndex.remove_categories   CategoricalIndex.remove_categories(*args, **kwargs)[source]
 
Remove the specified categories. removals must be included in the old categories. Values which were in the removed categories will be set to NaN  Parameters 
 
removals:category or list of categories


The categories which should be removed.  
inplace:bool, default False


Whether or not to remove the categories inplace or return a copy of this categorical with removed categories.  Deprecated since version 1.3.0.     Returns 
 
cat:Categorical or None


Categorical with removed categories or None if inplace=True.    Raises 
 ValueError

If the removals are not contained in the categories      See also  rename_categories

Rename categories.  reorder_categories

Reorder categories.  add_categories

Add new categories.  remove_unused_categories

Remove categories which are not used.  set_categories

Set the categories to the specified ones.    Examples 
>>> c = pd.Categorical(['a', 'c', 'b', 'c', 'd'])
>>> c
['a', 'c', 'b', 'c', 'd']
Categories (4, object): ['a', 'b', 'c', 'd']
  
>>> c.remove_categories(['d', 'a'])
[NaN, 'c', 'b', 'c', NaN]
Categories (2, object): ['b', 'c']
pandas.CategoricalIndex.remove_unused_categories   CategoricalIndex.remove_unused_categories(*args, **kwargs)[source]
 
Remove categories which are not used.  Parameters 
 
inplace:bool, default False


Whether or not to drop unused categories inplace or return a copy of this categorical with unused categories dropped.  Deprecated since version 1.2.0.     Returns 
 
cat:Categorical or None


Categorical with unused categories dropped or None if inplace=True.      See also  rename_categories

Rename categories.  reorder_categories

Reorder categories.  add_categories

Add new categories.  remove_categories

Remove the specified categories.  set_categories

Set the categories to the specified ones.    Examples 
>>> c = pd.Categorical(['a', 'c', 'b', 'c', 'd'])
>>> c
['a', 'c', 'b', 'c', 'd']
Categories (4, object): ['a', 'b', 'c', 'd']
  
>>> c[2] = 'a'
>>> c[4] = 'c'
>>> c
['a', 'c', 'a', 'c', 'c']
Categories (4, object): ['a', 'b', 'c', 'd']
  
>>> c.remove_unused_categories()
['a', 'c', 'a', 'c', 'c']
Categories (2, object): ['a', 'c']
pandas.CategoricalIndex.rename_categories   CategoricalIndex.rename_categories(*args, **kwargs)[source]
 
Rename categories.  Parameters 
 
new_categories:list-like, dict-like or callable


New categories which will replace old categories.  list-like: all items must be unique and the number of items in the new categories must match the existing number of categories. dict-like: specifies a mapping from old categories to new. Categories not contained in the mapping are passed through and extra categories in the mapping are ignored. callable : a callable that is called on all items in the old categories and whose return values comprise the new categories.   
inplace:bool, default False


Whether or not to rename the categories inplace or return a copy of this categorical with renamed categories.  Deprecated since version 1.3.0.     Returns 
 
cat:Categorical or None


Categorical with removed categories or None if inplace=True.    Raises 
 ValueError

If new categories are list-like and do not have the same number of items than the current categories or do not validate as categories      See also  reorder_categories

Reorder categories.  add_categories

Add new categories.  remove_categories

Remove the specified categories.  remove_unused_categories

Remove categories which are not used.  set_categories

Set the categories to the specified ones.    Examples 
>>> c = pd.Categorical(['a', 'a', 'b'])
>>> c.rename_categories([0, 1])
[0, 0, 1]
Categories (2, int64): [0, 1]
  For dict-like new_categories, extra keys are ignored and categories not in the dictionary are passed through 
>>> c.rename_categories({'a': 'A', 'c': 'C'})
['A', 'A', 'b']
Categories (2, object): ['A', 'b']
  You may also provide a callable to create the new categories 
>>> c.rename_categories(lambda x: x.upper())
['A', 'A', 'B']
Categories (2, object): ['A', 'B']