neulab/docprompting-conala huggingface dataset:
pandas.Index.array   Index.array
 
The ExtensionArray of the data backing this Series or Index.  Returns 
 ExtensionArray

An ExtensionArray of the values stored within. For extension types, this is the actual array. For NumPy native types, this is a thin (no copy) wrapper around numpy.ndarray. .array differs .values which may require converting the data to a different form.      See also  Index.to_numpy

Similar method that always returns a NumPy array.  Series.to_numpy

Similar method that always returns a NumPy array.    Notes This table lays out the different array types for each extension dtype within pandas.       
dtype array type    
category Categorical  
period PeriodArray  
interval IntervalArray  
IntegerNA IntegerArray  
string StringArray  
boolean BooleanArray  
datetime64[ns, tz] DatetimeArray    For any 3rd-party extension types, the array type will be an ExtensionArray. For all remaining dtypes .array will be a arrays.NumpyExtensionArray wrapping the actual ndarray stored within. If you absolutely need a NumPy array (possibly with copying / coercing data), then use Series.to_numpy() instead. Examples For regular NumPy types like int, and float, a PandasArray is returned. 
>>> pd.Series([1, 2, 3]).array
<PandasArray>
[1, 2, 3]
Length: 3, dtype: int64
  For extension types, like Categorical, the actual ExtensionArray is returned 
>>> ser = pd.Series(pd.Categorical(['a', 'b', 'a']))
>>> ser.array
['a', 'b', 'a']
Categories (2, object): ['a', 'b']
pandas.Index.asi8   propertyIndex.asi8
 
Integer representation of the values.  Returns 
 ndarray

An ndarray with int64 dtype.
pandas.Index.asof   finalIndex.asof(label)[source]
 
Return the label from the index, or, if not present, the previous one. Assuming that the index is sorted, return the passed index label if it is in the index, or return the previous index label if the passed one is not in the index.  Parameters 
 
label:object


The label up to which the method returns the latest index label.    Returns 
 object

The passed label if it is in the index. The previous label if the passed label is not in the sorted index or NaN if there is no such label.      See also  Series.asof

Return the latest value in a Series up to the passed index.  merge_asof

Perform an asof merge (similar to left join but it matches on nearest key rather than equal key).  Index.get_loc

An asof is a thin wrapper around get_loc with method=’pad’.    Examples Index.asof returns the latest index label up to the passed label. 
>>> idx = pd.Index(['2013-12-31', '2014-01-02', '2014-01-03'])
>>> idx.asof('2014-01-01')
'2013-12-31'
  If the label is in the index, the method returns the passed label. 
>>> idx.asof('2014-01-02')
'2014-01-02'
  If all of the labels in the index are later than the passed label, NaN is returned. 
>>> idx.asof('1999-01-02')
nan
  If the index is not sorted, an error is raised. 
>>> idx_not_sorted = pd.Index(['2013-12-31', '2015-01-02',
...                            '2014-01-03'])
>>> idx_not_sorted.asof('2013-12-31')
Traceback (most recent call last):
ValueError: index must be monotonic increasing or decreasing
pandas.Index.asof_locs   Index.asof_locs(where, mask)[source]
 
Return the locations (indices) of labels in the index. As in the asof function, if the label (a particular entry in where) is not in the index, the latest index label up to the passed label is chosen and its index returned. If all of the labels in the index are later than a label in where, -1 is returned. mask is used to ignore NA values in the index during calculation.  Parameters 
 
where:Index


An Index consisting of an array of timestamps.  
mask:np.ndarray[bool]


Array of booleans denoting where values in the original data are not NA.    Returns 
 np.ndarray[np.intp]

An array of locations (indices) of the labels from the Index which correspond to the return values of the asof function for every element in where.
pandas.Index.astype   Index.astype(dtype, copy=True)[source]
 
Create an Index with values cast to dtypes. The class of a new Index is determined by dtype. When conversion is impossible, a TypeError exception is raised.  Parameters 
 
dtype:numpy dtype or pandas type


Note that any signed integer dtype is treated as 'int64', and any unsigned integer dtype is treated as 'uint64', regardless of the size.  
copy:bool, default True


By default, astype always returns a newly allocated object. If copy is set to False and internal requirements on dtype are satisfied, the original data is used to create a new Index or the original Index is returned.    Returns 
 Index

Index with values cast to specified dtype.
pandas.Index.copy   Index.copy(name=None, deep=False, dtype=None, names=None)[source]
 
Make a copy of this object. Name and dtype sets those attributes on the new object.  Parameters 
 
name:Label, optional


Set name for new object.  
deep:bool, default False


dtype:numpy dtype or pandas type, optional


Set dtype for new object.  Deprecated since version 1.2.0: use astype method instead.   
names:list-like, optional


Kept for compatibility with MultiIndex. Should not be used.  Deprecated since version 1.4.0: use name instead.     Returns 
 Index

Index refer to new object which is a copy of this object.     Notes In most cases, there should be no functional difference from using deep, but if deep is passed it will attempt to deepcopy.
pandas.Index.delete   Index.delete(loc)[source]
 
Make new Index with passed location(-s) deleted.  Parameters 
 
loc:int or list of int


Location of item(-s) which will be deleted. Use a list of locations to delete more than one value at the same time.    Returns 
 Index

Will be same type as self, except for RangeIndex.      See also  numpy.delete

Delete any rows and column from NumPy array (ndarray).    Examples 
>>> idx = pd.Index(['a', 'b', 'c'])
>>> idx.delete(1)
Index(['a', 'c'], dtype='object')
  
>>> idx = pd.Index(['a', 'b', 'c'])
>>> idx.delete([0, 2])
Index(['b'], dtype='object')
pandas.Index.difference   finalIndex.difference(other, sort=None)[source]
 
Return a new Index with elements of index not in other. This is the set difference of two Index objects.  Parameters 
 
other:Index or array-like


sort:False or None, default None


Whether to sort the resulting index. By default, the values are attempted to be sorted, but any TypeError from incomparable elements is caught by pandas.  None : Attempt to sort the result, but catch any TypeErrors from comparing incomparable elements. False : Do not sort the result.     Returns 
 
difference:Index

   Examples 
>>> idx1 = pd.Index([2, 1, 3, 4])
>>> idx2 = pd.Index([3, 4, 5, 6])
>>> idx1.difference(idx2)
Int64Index([1, 2], dtype='int64')
>>> idx1.difference(idx2, sort=False)
Int64Index([2, 1], dtype='int64')
pandas.Index.drop   Index.drop(labels, errors='raise')[source]
 
Make new Index with passed list of labels deleted.  Parameters 
 
labels:array-like or scalar


errors:{‘ignore’, ‘raise’}, default ‘raise’


If ‘ignore’, suppress error and existing labels are dropped.    Returns 
 
dropped:Index


Will be same type as self, except for RangeIndex.    Raises 
 KeyError

If not all of the labels are found in the selected axis
pandas.Index.drop_duplicates   Index.drop_duplicates(keep='first')[source]
 
Return Index with duplicate values removed.  Parameters 
 
keep:{‘first’, ‘last’, False}, default ‘first’


 ‘first’ : Drop duplicates except for the first occurrence. ‘last’ : Drop duplicates except for the last occurrence. False : Drop all duplicates.     Returns 
 
deduplicated:Index

    See also  Series.drop_duplicates

Equivalent method on Series.  DataFrame.drop_duplicates

Equivalent method on DataFrame.  Index.duplicated

Related method on Index, indicating duplicate Index values.    Examples Generate an pandas.Index with duplicate values. 
>>> idx = pd.Index(['lama', 'cow', 'lama', 'beetle', 'lama', 'hippo'])
  The keep parameter controls which duplicate values are removed. The value ‘first’ keeps the first occurrence for each set of duplicated entries. The default value of keep is ‘first’. 
>>> idx.drop_duplicates(keep='first')
Index(['lama', 'cow', 'beetle', 'hippo'], dtype='object')
  The value ‘last’ keeps the last occurrence for each set of duplicated entries. 
>>> idx.drop_duplicates(keep='last')
Index(['cow', 'beetle', 'lama', 'hippo'], dtype='object')
  The value False discards all sets of duplicated entries. 
>>> idx.drop_duplicates(keep=False)
Index(['cow', 'beetle', 'hippo'], dtype='object')
pandas.Index.droplevel   finalIndex.droplevel(level=0)[source]
 
Return index with requested level(s) removed. If resulting index has only 1 level left, the result will be of Index type, not MultiIndex.  Parameters 
 
level:int, str, or list-like, default 0


If a string is given, must be the name of a level If list-like, elements must be names or indexes of levels.    Returns 
 Index or MultiIndex
   Examples 
>>> mi = pd.MultiIndex.from_arrays(
... [[1, 2], [3, 4], [5, 6]], names=['x', 'y', 'z'])
>>> mi
MultiIndex([(1, 3, 5),
            (2, 4, 6)],
           names=['x', 'y', 'z'])
  
>>> mi.droplevel()
MultiIndex([(3, 5),
            (4, 6)],
           names=['y', 'z'])
  
>>> mi.droplevel(2)
MultiIndex([(1, 3),
            (2, 4)],
           names=['x', 'y'])
  
>>> mi.droplevel('z')
MultiIndex([(1, 3),
            (2, 4)],
           names=['x', 'y'])
  
>>> mi.droplevel(['x', 'y'])
Int64Index([5, 6], dtype='int64', name='z')
pandas.Index.dropna   Index.dropna(how='any')[source]
 
Return Index without NA/NaN values.  Parameters 
 
how:{‘any’, ‘all’}, default ‘any’


If the Index is a MultiIndex, drop the value when any or all levels are NaN.    Returns 
 Index
pandas.Index.dtype   Index.dtype
 
Return the dtype object of the underlying data.
pandas.Index.duplicated   Index.duplicated(keep='first')[source]
 
Indicate duplicate index values. Duplicated values are indicated as True values in the resulting array. Either all duplicates, all except the first, or all except the last occurrence of duplicates can be indicated.  Parameters 
 
keep:{‘first’, ‘last’, False}, default ‘first’


The value or values in a set of duplicates to mark as missing.  ‘first’ : Mark duplicates as True except for the first occurrence. ‘last’ : Mark duplicates as True except for the last occurrence. False : Mark all duplicates as True.     Returns 
 np.ndarray[bool]
    See also  Series.duplicated

Equivalent method on pandas.Series.  DataFrame.duplicated

Equivalent method on pandas.DataFrame.  Index.drop_duplicates

Remove duplicate values from Index.    Examples By default, for each set of duplicated values, the first occurrence is set to False and all others to True: 
>>> idx = pd.Index(['lama', 'cow', 'lama', 'beetle', 'lama'])
>>> idx.duplicated()
array([False, False,  True, False,  True])
  which is equivalent to 
>>> idx.duplicated(keep='first')
array([False, False,  True, False,  True])
  By using ‘last’, the last occurrence of each set of duplicated values is set on False and all others on True: 
>>> idx.duplicated(keep='last')
array([ True, False,  True, False, False])
  By setting keep on False, all duplicates are True: 
>>> idx.duplicated(keep=False)
array([ True, False,  True, False,  True])
pandas.Index.equals   Index.equals(other)[source]
 
Determine if two Index object are equal. The things that are being compared are:  The elements inside the Index object. The order of the elements inside the Index object.   Parameters 
 
other:Any


The other object to compare against.    Returns 
 bool

True if “other” is an Index and it has the same elements and order as the calling index; False otherwise.     Examples 
>>> idx1 = pd.Index([1, 2, 3])
>>> idx1
Int64Index([1, 2, 3], dtype='int64')
>>> idx1.equals(pd.Index([1, 2, 3]))
True
  The elements inside are compared 
>>> idx2 = pd.Index(["1", "2", "3"])
>>> idx2
Index(['1', '2', '3'], dtype='object')
  
>>> idx1.equals(idx2)
False
  The order is compared 
>>> ascending_idx = pd.Index([1, 2, 3])
>>> ascending_idx
Int64Index([1, 2, 3], dtype='int64')
>>> descending_idx = pd.Index([3, 2, 1])
>>> descending_idx
Int64Index([3, 2, 1], dtype='int64')
>>> ascending_idx.equals(descending_idx)
False
  The dtype is not compared 
>>> int64_idx = pd.Int64Index([1, 2, 3])
>>> int64_idx
Int64Index([1, 2, 3], dtype='int64')
>>> uint64_idx = pd.UInt64Index([1, 2, 3])
>>> uint64_idx
UInt64Index([1, 2, 3], dtype='uint64')
>>> int64_idx.equals(uint64_idx)
True
pandas.Index.fillna   Index.fillna(value=None, downcast=None)[source]
 
Fill NA/NaN values with the specified value.  Parameters 
 
value:scalar


Scalar value to use to fill holes (e.g. 0). This value cannot be a list-likes.  
downcast:dict, default is None


A dict of item->dtype of what to downcast if possible, or the string ‘infer’ which will try to downcast to an appropriate equal type (e.g. float64 to int64 if possible).    Returns 
 Index
    See also  DataFrame.fillna

Fill NaN values of a DataFrame.  Series.fillna

Fill NaN Values of a Series.
pandas.Index.format   Index.format(name=False, formatter=None, na_rep='NaN')[source]
 
Render a string representation of the Index.
pandas.Index.get_indexer   finalIndex.get_indexer(target, method=None, limit=None, tolerance=None)[source]
 
Compute indexer and mask for new index given the current index. The indexer should be then used as an input to ndarray.take to align the current data to the new index.  Parameters 
 
target:Index


method:{None, ‘pad’/’ffill’, ‘backfill’/’bfill’, ‘nearest’}, optional


 default: exact matches only. pad / ffill: find the PREVIOUS index value if no exact match. backfill / bfill: use NEXT index value if no exact match nearest: use the NEAREST index value if no exact match. Tied distances are broken by preferring the larger index value.   
limit:int, optional


Maximum number of consecutive labels in target to match for inexact matches.  
tolerance:optional


Maximum distance between original and new labels for inexact matches. The values of the index at the matching locations must satisfy the equation abs(index[indexer] - target) <= tolerance. Tolerance may be a scalar value, which applies the same tolerance to all values, or list-like, which applies variable tolerance per element. List-like includes list, tuple, array, Series, and must be the same size as the index and its dtype must exactly match the index’s type.    Returns 
 
indexer:np.ndarray[np.intp]


Integers from 0 to n - 1 indicating that the index at these positions matches the corresponding target values. Missing values in the target are marked by -1.     Notes Returns -1 for unmatched values, for further explanation see the example below. Examples 
>>> index = pd.Index(['c', 'a', 'b'])
>>> index.get_indexer(['a', 'b', 'x'])
array([ 1,  2, -1])
  Notice that the return value is an array of locations in index and x is marked by -1, as it is not in index.
pandas.Index.get_indexer_for   finalIndex.get_indexer_for(target)[source]
 
Guaranteed return of an indexer even when non-unique. This dispatches to get_indexer or get_indexer_non_unique as appropriate.  Returns 
 np.ndarray[np.intp]

List of indices.     Examples 
>>> idx = pd.Index([np.nan, 'var1', np.nan])
>>> idx.get_indexer_for([np.nan])
array([0, 2])
pandas.Index.get_indexer_non_unique   Index.get_indexer_non_unique(target)[source]
 
Compute indexer and mask for new index given the current index. The indexer should be then used as an input to ndarray.take to align the current data to the new index.  Parameters 
 
target:Index

  Returns 
 
indexer:np.ndarray[np.intp]


Integers from 0 to n - 1 indicating that the index at these positions matches the corresponding target values. Missing values in the target are marked by -1.  
missing:np.ndarray[np.intp]


An indexer into the target of the values not found. These correspond to the -1 in the indexer array.
pandas.Index.get_level_values   Index.get_level_values(level)[source]
 
Return an Index of values for requested level. This is primarily useful to get an individual level of values from a MultiIndex, but is provided on Index as well for compatibility.  Parameters 
 
level:int or str


It is either the integer position or the name of the level.    Returns 
 Index

Calling object, as there is only one level in the Index.      See also  MultiIndex.get_level_values

Get values for a level of a MultiIndex.    Notes For Index, level should be 0, since there are no multiple levels. Examples 
>>> idx = pd.Index(list('abc'))
>>> idx
Index(['a', 'b', 'c'], dtype='object')
  Get level values by supplying level as integer: 
>>> idx.get_level_values(0)
Index(['a', 'b', 'c'], dtype='object')
pandas.Index.get_loc   Index.get_loc(key, method=None, tolerance=None)[source]
 
Get integer location, slice or boolean mask for requested label.  Parameters 
 
key:label


method:{None, ‘pad’/’ffill’, ‘backfill’/’bfill’, ‘nearest’}, optional


 default: exact matches only. pad / ffill: find the PREVIOUS index value if no exact match. backfill / bfill: use NEXT index value if no exact match nearest: use the NEAREST index value if no exact match. Tied distances are broken by preferring the larger index value.   
tolerance:int or float, optional


Maximum distance from index value for inexact matches. The value of the index at the matching location must satisfy the equation abs(index[loc] - key) <= tolerance.    Returns 
 
loc:int if unique index, slice if monotonic index, else mask

   Examples 
>>> unique_index = pd.Index(list('abc'))
>>> unique_index.get_loc('b')
1
  
>>> monotonic_index = pd.Index(list('abbc'))
>>> monotonic_index.get_loc('b')
slice(1, 3, None)
  
>>> non_monotonic_index = pd.Index(list('abcb'))
>>> non_monotonic_index.get_loc('b')
array([False,  True, False,  True])
pandas.Index.get_slice_bound   Index.get_slice_bound(label, side, kind=NoDefault.no_default)[source]
 
Calculate slice bound that corresponds to given label. Returns leftmost (one-past-the-rightmost if side=='right') position of given label.  Parameters 
 
label:object


side:{‘left’, ‘right’}


kind:{‘loc’, ‘getitem’} or None


 Deprecated since version 1.4.0.     Returns 
 int

Index of label.
pandas.Index.get_value   finalIndex.get_value(series, key)[source]
 
Fast lookup of value from 1-dimensional ndarray. Only use this if you know what you’re doing.  Returns 
 scalar or Series
pandas.Index.groupby   finalIndex.groupby(values)[source]
 
Group the index labels by a given array of values.  Parameters 
 
values:array


Values used to determine the groups.    Returns 
 dict

{group name -> group labels}
pandas.Index.has_duplicates   propertyIndex.has_duplicates
 
Check if the Index has duplicate values.  Returns 
 bool

Whether or not the Index has duplicate values.     Examples 
>>> idx = pd.Index([1, 5, 7, 7])
>>> idx.has_duplicates
True
  
>>> idx = pd.Index([1, 5, 7])
>>> idx.has_duplicates
False
  
>>> idx = pd.Index(["Watermelon", "Orange", "Apple",
...                 "Watermelon"]).astype("category")
>>> idx.has_duplicates
True
  
>>> idx = pd.Index(["Orange", "Apple",
...                 "Watermelon"]).astype("category")
>>> idx.has_duplicates
False
pandas.Index.hasnans   Index.hasnans
 
Return True if there are any NaNs. Enables various performance speedups.
pandas.Index.holds_integer   finalIndex.holds_integer()[source]
 
Whether the type is an integer type.
pandas.Index.identical   finalIndex.identical(other)[source]
 
Similar to equals, but checks that object attributes and types are also equal.  Returns 
 bool

If two Index objects have equal elements and same type True, otherwise False.
pandas.Index.inferred_type   Index.inferred_type
 
Return a string of the type inferred from the values.
pandas.Index.insert   Index.insert(loc, item)[source]
 
Make new Index inserting new item at location. Follows Python numpy.insert semantics for negative values.  Parameters 
 
loc:int


item:object

  Returns 
 
new_index:Index
pandas.Index.intersection   finalIndex.intersection(other, sort=False)[source]
 
Form the intersection of two Index objects. This returns a new Index with elements common to the index and other.  Parameters 
 
other:Index or array-like


sort:False or None, default False


Whether to sort the resulting index.  False : do not sort the result. None : sort the result, except when self and other are equal or when the values cannot be compared.     Returns 
 
intersection:Index

   Examples 
>>> idx1 = pd.Index([1, 2, 3, 4])
>>> idx2 = pd.Index([3, 4, 5, 6])
>>> idx1.intersection(idx2)
Int64Index([3, 4], dtype='int64')
pandas.Index.is_   finalIndex.is_(other)[source]
 
More flexible, faster check like is but that works through views. Note: this is not the same as Index.identical(), which checks that metadata is also the same.  Parameters 
 
other:object


Other object to compare against.    Returns 
 bool

True if both have same underlying data, False otherwise.      See also  Index.identical

Works like Index.is_ but also checks metadata.
pandas.Index.is_all_dates   Index.is_all_dates
 
Whether or not the index values only consist of dates.
pandas.Index.is_boolean   finalIndex.is_boolean()[source]
 
Check if the Index only consists of booleans.  Returns 
 bool

Whether or not the Index only consists of booleans.      See also  is_integer

Check if the Index only consists of integers.  is_floating

Check if the Index is a floating type.  is_numeric

Check if the Index only consists of numeric data.  is_object

Check if the Index is of the object dtype.  is_categorical

Check if the Index holds categorical data.  is_interval

Check if the Index holds Interval objects.  is_mixed

Check if the Index holds data with mixed data types.    Examples 
>>> idx = pd.Index([True, False, True])
>>> idx.is_boolean()
True
  
>>> idx = pd.Index(["True", "False", "True"])
>>> idx.is_boolean()
False
  
>>> idx = pd.Index([True, False, "True"])
>>> idx.is_boolean()
False
pandas.Index.is_categorical   finalIndex.is_categorical()[source]
 
Check if the Index holds categorical data.  Returns 
 bool

True if the Index is categorical.      See also  CategoricalIndex

Index for categorical data.  is_boolean

Check if the Index only consists of booleans.  is_integer

Check if the Index only consists of integers.  is_floating

Check if the Index is a floating type.  is_numeric

Check if the Index only consists of numeric data.  is_object

Check if the Index is of the object dtype.  is_interval

Check if the Index holds Interval objects.  is_mixed

Check if the Index holds data with mixed data types.    Examples 
>>> idx = pd.Index(["Watermelon", "Orange", "Apple",
...                 "Watermelon"]).astype("category")
>>> idx.is_categorical()
True
  
>>> idx = pd.Index([1, 3, 5, 7])
>>> idx.is_categorical()
False
  
>>> s = pd.Series(["Peter", "Victor", "Elisabeth", "Mar"])
>>> s
0        Peter
1       Victor
2    Elisabeth
3          Mar
dtype: object
>>> s.index.is_categorical()
False
pandas.Index.is_floating   finalIndex.is_floating()[source]
 
Check if the Index is a floating type. The Index may consist of only floats, NaNs, or a mix of floats, integers, or NaNs.  Returns 
 bool

Whether or not the Index only consists of only consists of floats, NaNs, or a mix of floats, integers, or NaNs.      See also  is_boolean

Check if the Index only consists of booleans.  is_integer

Check if the Index only consists of integers.  is_numeric

Check if the Index only consists of numeric data.  is_object

Check if the Index is of the object dtype.  is_categorical

Check if the Index holds categorical data.  is_interval

Check if the Index holds Interval objects.  is_mixed

Check if the Index holds data with mixed data types.    Examples 
>>> idx = pd.Index([1.0, 2.0, 3.0, 4.0])
>>> idx.is_floating()
True
  
>>> idx = pd.Index([1.0, 2.0, np.nan, 4.0])
>>> idx.is_floating()
True
  
>>> idx = pd.Index([1, 2, 3, 4, np.nan])
>>> idx.is_floating()
True
  
>>> idx = pd.Index([1, 2, 3, 4])
>>> idx.is_floating()
False