neulab/docprompting-conala huggingface dataset:
pandas.core.groupby.DataFrameGroupBy.quantile   DataFrameGroupBy.quantile(q=0.5, interpolation='linear')[source]
 
Return group values at the given quantile, a la numpy.percentile.  Parameters 
 
q:float or array-like, default 0.5 (50% quantile)


Value(s) between 0 and 1 providing the quantile(s) to compute.  
interpolation:{‘linear’, ‘lower’, ‘higher’, ‘midpoint’, ‘nearest’}


Method to use when the desired quantile falls between two points.    Returns 
 Series or DataFrame

Return type determined by caller of GroupBy object.      See also  Series.quantile

Similar method for Series.  DataFrame.quantile

Similar method for DataFrame.  numpy.percentile

NumPy method to compute qth percentile.    Examples 
>>> df = pd.DataFrame([
...     ['a', 1], ['a', 2], ['a', 3],
...     ['b', 1], ['b', 3], ['b', 5]
... ], columns=['key', 'val'])
>>> df.groupby('key').quantile()
    val
key
a    2.0
b    3.0
pandas.core.groupby.DataFrameGroupBy.rank   DataFrameGroupBy.rank(method='average', ascending=True, na_option='keep', pct=False, axis=0)[source]
 
Provide the rank of values within each group.  Parameters 
 
method:{‘average’, ‘min’, ‘max’, ‘first’, ‘dense’}, default ‘average’


 average: average rank of group. min: lowest rank in group. max: highest rank in group. first: ranks assigned in order they appear in the array. dense: like ‘min’, but rank always increases by 1 between groups.   
ascending:bool, default True


False for ranks by high (1) to low (N).  
na_option:{‘keep’, ‘top’, ‘bottom’}, default ‘keep’


 keep: leave NA values where they are. top: smallest rank if ascending. bottom: smallest rank if descending.   
pct:bool, default False


Compute percentage rank of data within each group.  
axis:int, default 0


The axis of the object over which to compute the rank.    Returns 
 DataFrame with ranking of values within each group
    See also  Series.groupby

Apply a function groupby to a Series.  DataFrame.groupby

Apply a function groupby to each row or column of a DataFrame.    Examples 
>>> df = pd.DataFrame(
...     {
...         "group": ["a", "a", "a", "a", "a", "b", "b", "b", "b", "b"],
...         "value": [2, 4, 2, 3, 5, 1, 2, 4, 1, 5],
...     }
... )
>>> df
  group  value
0     a      2
1     a      4
2     a      2
3     a      3
4     a      5
5     b      1
6     b      2
7     b      4
8     b      1
9     b      5
>>> for method in ['average', 'min', 'max', 'dense', 'first']:
...     df[f'{method}_rank'] = df.groupby('group')['value'].rank(method)
>>> df
  group  value  average_rank  min_rank  max_rank  dense_rank  first_rank
0     a      2           1.5       1.0       2.0         1.0         1.0
1     a      4           4.0       4.0       4.0         3.0         4.0
2     a      2           1.5       1.0       2.0         1.0         2.0
3     a      3           3.0       3.0       3.0         2.0         3.0
4     a      5           5.0       5.0       5.0         4.0         5.0
5     b      1           1.5       1.0       2.0         1.0         1.0
6     b      2           3.0       3.0       3.0         2.0         3.0
7     b      4           4.0       4.0       4.0         3.0         4.0
8     b      1           1.5       1.0       2.0         1.0         2.0
9     b      5           5.0       5.0       5.0         4.0         5.0
pandas.core.groupby.DataFrameGroupBy.resample   DataFrameGroupBy.resample(rule, *args, **kwargs)[source]
 
Provide resampling when using a TimeGrouper. Given a grouper, the function resamples it according to a string “string” -> “frequency”. See the frequency aliases documentation for more details.  Parameters 
 
rule:str or DateOffset


The offset string or object representing target grouper conversion.  *args, **kwargs

Possible arguments are how, fill_method, limit, kind and on, and other arguments of TimeGrouper.    Returns 
 Grouper

Return a new grouper with our resampler appended.      See also  Grouper

Specify a frequency to resample with when grouping by a key.  DatetimeIndex.resample

Frequency conversion and resampling of time series.    Examples 
>>> idx = pd.date_range('1/1/2000', periods=4, freq='T')
>>> df = pd.DataFrame(data=4 * [range(2)],
...                   index=idx,
...                   columns=['a', 'b'])
>>> df.iloc[2, 0] = 5
>>> df
                    a  b
2000-01-01 00:00:00  0  1
2000-01-01 00:01:00  0  1
2000-01-01 00:02:00  5  1
2000-01-01 00:03:00  0  1
  Downsample the DataFrame into 3 minute bins and sum the values of the timestamps falling into a bin. 
>>> df.groupby('a').resample('3T').sum()
                         a  b
a
0   2000-01-01 00:00:00  0  2
    2000-01-01 00:03:00  0  1
5   2000-01-01 00:00:00  5  1
  Upsample the series into 30 second bins. 
>>> df.groupby('a').resample('30S').sum()
                    a  b
a
0   2000-01-01 00:00:00  0  1
    2000-01-01 00:00:30  0  0
    2000-01-01 00:01:00  0  1
    2000-01-01 00:01:30  0  0
    2000-01-01 00:02:00  0  0
    2000-01-01 00:02:30  0  0
    2000-01-01 00:03:00  0  1
5   2000-01-01 00:02:00  5  1
  Resample by month. Values are assigned to the month of the period. 
>>> df.groupby('a').resample('M').sum()
            a  b
a
0   2000-01-31  0  3
5   2000-01-31  5  1
  Downsample the series into 3 minute bins as above, but close the right side of the bin interval. 
>>> df.groupby('a').resample('3T', closed='right').sum()
                         a  b
a
0   1999-12-31 23:57:00  0  1
    2000-01-01 00:00:00  0  2
5   2000-01-01 00:00:00  5  1
  Downsample the series into 3 minute bins and close the right side of the bin interval, but label each bin using the right edge instead of the left. 
>>> df.groupby('a').resample('3T', closed='right', label='right').sum()
                         a  b
a
0   2000-01-01 00:00:00  0  1
    2000-01-01 00:03:00  0  2
5   2000-01-01 00:03:00  5  1
pandas.core.groupby.DataFrameGroupBy.sample   DataFrameGroupBy.sample(n=None, frac=None, replace=False, weights=None, random_state=None)[source]
 
Return a random sample of items from each group. You can use random_state for reproducibility.  New in version 1.1.0.   Parameters 
 
n:int, optional


Number of items to return for each group. Cannot be used with frac and must be no larger than the smallest group unless replace is True. Default is one if frac is None.  
frac:float, optional


Fraction of items to return. Cannot be used with n.  
replace:bool, default False


Allow or disallow sampling of the same row more than once.  
weights:list-like, optional


Default None results in equal probability weighting. If passed a list-like then values must have the same length as the underlying DataFrame or Series object and will be used as sampling probabilities after normalization within each group. Values must be non-negative with at least one positive element within each group.  
random_state:int, array-like, BitGenerator, np.random.RandomState, np.random.Generator, optional


If int, array-like, or BitGenerator, seed for random number generator. If np.random.RandomState or np.random.Generator, use as given.  Changed in version 1.4.0: np.random.Generator objects now accepted     Returns 
 Series or DataFrame

A new object of same type as caller containing items randomly sampled within each group from the caller object.      See also  DataFrame.sample

Generate random samples from a DataFrame object.  numpy.random.choice

Generate a random sample from a given 1-D numpy array.    Examples 
>>> df = pd.DataFrame(
...     {"a": ["red"] * 2 + ["blue"] * 2 + ["black"] * 2, "b": range(6)}
... )
>>> df
       a  b
0    red  0
1    red  1
2   blue  2
3   blue  3
4  black  4
5  black  5
  Select one row at random for each distinct value in column a. The random_state argument can be used to guarantee reproducibility: 
>>> df.groupby("a").sample(n=1, random_state=1)
       a  b
4  black  4
2   blue  2
1    red  1
  Set frac to sample fixed proportions rather than counts: 
>>> df.groupby("a")["b"].sample(frac=0.5, random_state=2)
5    5
2    2
0    0
Name: b, dtype: int64
  Control sample probabilities within groups by setting weights: 
>>> df.groupby("a").sample(
...     n=1,
...     weights=[1, 1, 1, 0, 0, 1],
...     random_state=1,
... )
       a  b
5  black  5
2   blue  2
0    red  0
pandas.core.groupby.DataFrameGroupBy.shift   DataFrameGroupBy.shift(periods=1, freq=None, axis=0, fill_value=None)[source]
 
Shift each group by periods observations. If freq is passed, the index will be increased using the periods and the freq.  Parameters 
 
periods:int, default 1


Number of periods to shift.  
freq:str, optional


Frequency string.  
axis:axis to shift, default 0


Shift direction.  
fill_value:optional


The scalar value to use for newly introduced missing values.    Returns 
 Series or DataFrame

Object shifted within each group.      See also  Index.shift

Shift values of Index.  tshift

Shift the time index, using the index’s frequency if available.
pandas.core.groupby.DataFrameGroupBy.size   DataFrameGroupBy.size()[source]
 
Compute group sizes.  Returns 
 DataFrame or Series

Number of rows in each group as a Series if as_index is True or a DataFrame if as_index is False.      See also  Series.groupby

Apply a function groupby to a Series.  DataFrame.groupby

Apply a function groupby to each row or column of a DataFrame.
pandas.core.groupby.DataFrameGroupBy.skew   propertyDataFrameGroupBy.skew
 
Return unbiased skew over requested axis. Normalized by N-1.  Parameters 
 
axis:{index (0), columns (1)}


Axis for the function to be applied on.  
skipna:bool, default True


Exclude NA/null values when computing the result.  
level:int or level name, default None


If the axis is a MultiIndex (hierarchical), count along a particular level, collapsing into a Series.  
numeric_only:bool, default None


Include only float, int, boolean columns. If None, will attempt to use everything, then use only numeric data. Not implemented for Series.  **kwargs

Additional keyword arguments to be passed to the function.    Returns 
 Series or DataFrame (if level specified)
pandas.core.groupby.DataFrameGroupBy.take   propertyDataFrameGroupBy.take
 
Return the elements in the given positional indices along an axis. This means that we are not indexing according to actual values in the index attribute of the object. We are indexing according to the actual position of the element in the object.  Parameters 
 
indices:array-like


An array of ints indicating which positions to take.  
axis:{0 or ‘index’, 1 or ‘columns’, None}, default 0


The axis on which to select elements. 0 means that we are selecting rows, 1 means that we are selecting columns.  
is_copy:bool


Before pandas 1.0, is_copy=False can be specified to ensure that the return value is an actual copy. Starting with pandas 1.0, take always returns a copy, and the keyword is therefore deprecated.  Deprecated since version 1.0.0.   **kwargs

For compatibility with numpy.take(). Has no effect on the output.    Returns 
 
taken:same type as caller


An array-like containing the elements taken from the object.      See also  DataFrame.loc

Select a subset of a DataFrame by labels.  DataFrame.iloc

Select a subset of a DataFrame by positions.  numpy.take

Take elements from an array along an axis.    Examples 
>>> df = pd.DataFrame([('falcon', 'bird', 389.0),
...                    ('parrot', 'bird', 24.0),
...                    ('lion', 'mammal', 80.5),
...                    ('monkey', 'mammal', np.nan)],
...                   columns=['name', 'class', 'max_speed'],
...                   index=[0, 2, 3, 1])
>>> df
     name   class  max_speed
0  falcon    bird      389.0
2  parrot    bird       24.0
3    lion  mammal       80.5
1  monkey  mammal        NaN
  Take elements at positions 0 and 3 along the axis 0 (default). Note how the actual indices selected (0 and 1) do not correspond to our selected indices 0 and 3. That’s because we are selecting the 0th and 3rd rows, not rows whose indices equal 0 and 3. 
>>> df.take([0, 3])
     name   class  max_speed
0  falcon    bird      389.0
1  monkey  mammal        NaN
  Take elements at indices 1 and 2 along the axis 1 (column selection). 
>>> df.take([1, 2], axis=1)
    class  max_speed
0    bird      389.0
2    bird       24.0
3  mammal       80.5
1  mammal        NaN
  We may take elements using negative integers for positive indices, starting from the end of the object, just like with Python lists. 
>>> df.take([-1, -2])
     name   class  max_speed
1  monkey  mammal        NaN
3    lion  mammal       80.5
pandas.core.groupby.DataFrameGroupBy.tshift   propertyDataFrameGroupBy.tshift
 
Shift the time index, using the index’s frequency if available.  Deprecated since version 1.1.0: Use shift instead.   Parameters 
 
periods:int


Number of periods to move, can be positive or negative.  
freq:DateOffset, timedelta, or str, default None


Increment to use from the tseries module or time rule expressed as a string (e.g. ‘EOM’).  
axis:{0 or ‘index’, 1 or ‘columns’, None}, default 0


Corresponds to the axis that contains the Index.    Returns 
 
shifted:Series/DataFrame

   Notes If freq is not specified then tries to use the freq or inferred_freq attributes of the index. If neither of those attributes exist, a ValueError is thrown
pandas.core.groupby.GroupBy.__iter__   GroupBy.__iter__()[source]
 
Groupby iterator.  Returns 
 Generator yielding sequence of (name, subsetted object)
for each group
pandas.core.groupby.GroupBy.agg   GroupBy.agg(func, *args, **kwargs)[source]
pandas.core.groupby.GroupBy.all   finalGroupBy.all(skipna=True)[source]
 
Return True if all values in the group are truthful, else False.  Parameters 
 
skipna:bool, default True


Flag to ignore nan values during truth testing.    Returns 
 Series or DataFrame

DataFrame or Series of boolean values, where a value is True if all elements are True within its respective group, False otherwise.      See also  Series.groupby

Apply a function groupby to a Series.  DataFrame.groupby

Apply a function groupby to each row or column of a DataFrame.
pandas.core.groupby.GroupBy.any   finalGroupBy.any(skipna=True)[source]
 
Return True if any value in the group is truthful, else False.  Parameters 
 
skipna:bool, default True


Flag to ignore nan values during truth testing.    Returns 
 Series or DataFrame

DataFrame or Series of boolean values, where a value is True if any element is True within its respective group, False otherwise.      See also  Series.groupby

Apply a function groupby to a Series.  DataFrame.groupby

Apply a function groupby to each row or column of a DataFrame.
pandas.core.groupby.GroupBy.apply   GroupBy.apply(func, *args, **kwargs)[source]
 
Apply function func group-wise and combine the results together. The function passed to apply must take a dataframe as its first argument and return a DataFrame, Series or scalar. apply will then take care of combining the results back together into a single dataframe or series. apply is therefore a highly flexible grouping method. While apply is a very flexible method, its downside is that using it can be quite a bit slower than using more specific methods like agg or transform. Pandas offers a wide range of method that will be much faster than using apply for their specific purposes, so try to use them before reaching for apply.  Parameters 
 
func:callable


A callable that takes a dataframe as its first argument, and returns a dataframe, a series or a scalar. In addition the callable may take positional and keyword arguments.  
args, kwargs:tuple and dict


Optional positional and keyword arguments to pass to func.    Returns 
 
applied:Series or DataFrame

    See also  pipe

Apply function to the full GroupBy object instead of to each group.  aggregate

Apply aggregate function to the GroupBy object.  transform

Apply function column-by-column to the GroupBy object.  Series.apply

Apply a function to a Series.  DataFrame.apply

Apply a function to each row or column of a DataFrame.    Notes  Changed in version 1.3.0: The resulting dtype will reflect the return value of the passed func, see the examples below.  Functions that mutate the passed object can produce unexpected behavior or errors and are not supported. See Mutating with User Defined Function (UDF) methods for more details. Examples 
>>> df = pd.DataFrame({'A': 'a a b'.split(),
...                    'B': [1,2,3],
...                    'C': [4,6,5]})
>>> g = df.groupby('A')
  Notice that g has two groups, a and b. Calling apply in various ways, we can get different grouping results: Example 1: below the function passed to apply takes a DataFrame as its argument and returns a DataFrame. apply combines the result for each group together into a new DataFrame: 
>>> g[['B', 'C']].apply(lambda x: x / x.sum())
          B    C
0  0.333333  0.4
1  0.666667  0.6
2  1.000000  1.0
  Example 2: The function passed to apply takes a DataFrame as its argument and returns a Series. apply combines the result for each group together into a new DataFrame.  Changed in version 1.3.0: The resulting dtype will reflect the return value of the passed func.  
>>> g[['B', 'C']].apply(lambda x: x.astype(float).max() - x.min())
     B    C
A
a  1.0  2.0
b  0.0  0.0
  Example 3: The function passed to apply takes a DataFrame as its argument and returns a scalar. apply combines the result for each group together into a Series, including setting the index as appropriate: 
>>> g.apply(lambda x: x.C.max() - x.B.min())
A
a    5
b    2
dtype: int64
pandas.core.groupby.GroupBy.backfill   GroupBy.backfill(limit=None)[source]
 
Backward fill the values.  Parameters 
 
limit:int, optional


Limit of how many values to fill.    Returns 
 Series or DataFrame

Object with missing values filled.      See also  Series.bfill

Backward fill the missing values in the dataset.  DataFrame.bfill

Backward fill the missing values in the dataset.  Series.fillna

Fill NaN values of a Series.  DataFrame.fillna

Fill NaN values of a DataFrame.
pandas.core.groupby.GroupBy.bfill   finalGroupBy.bfill(limit=None)[source]
 
Backward fill the values.  Parameters 
 
limit:int, optional


Limit of how many values to fill.    Returns 
 Series or DataFrame

Object with missing values filled.      See also  Series.bfill

Backward fill the missing values in the dataset.  DataFrame.bfill

Backward fill the missing values in the dataset.  Series.fillna

Fill NaN values of a Series.  DataFrame.fillna

Fill NaN values of a DataFrame.
pandas.core.groupby.GroupBy.count   finalGroupBy.count()[source]
 
Compute count of group, excluding missing values.  Returns 
 Series or DataFrame

Count of values within each group.      See also  Series.groupby

Apply a function groupby to a Series.  DataFrame.groupby

Apply a function groupby to each row or column of a DataFrame.
pandas.core.groupby.GroupBy.cumcount   finalGroupBy.cumcount(ascending=True)[source]
 
Number each item in each group from 0 to the length of that group - 1. Essentially this is equivalent to 
self.apply(lambda x: pd.Series(np.arange(len(x)), x.index))
   Parameters 
 
ascending:bool, default True


If False, number in reverse, from length of group - 1 to 0.    Returns 
 Series

Sequence number of each element within each group.      See also  ngroup

Number the groups themselves.    Examples 
>>> df = pd.DataFrame([['a'], ['a'], ['a'], ['b'], ['b'], ['a']],
...                   columns=['A'])
>>> df
   A
0  a
1  a
2  a
3  b
4  b
5  a
>>> df.groupby('A').cumcount()
0    0
1    1
2    2
3    0
4    1
5    3
dtype: int64
>>> df.groupby('A').cumcount(ascending=False)
0    3
1    2
2    1
3    1
4    0
5    0
dtype: int64
pandas.core.groupby.GroupBy.cummax   finalGroupBy.cummax(axis=0, **kwargs)[source]
 
Cumulative max for each group.  Returns 
 Series or DataFrame
    See also  Series.groupby

Apply a function groupby to a Series.  DataFrame.groupby

Apply a function groupby to each row or column of a DataFrame.
pandas.core.groupby.GroupBy.cummin   finalGroupBy.cummin(axis=0, **kwargs)[source]
 
Cumulative min for each group.  Returns 
 Series or DataFrame
    See also  Series.groupby

Apply a function groupby to a Series.  DataFrame.groupby

Apply a function groupby to each row or column of a DataFrame.
pandas.core.groupby.GroupBy.cumprod   finalGroupBy.cumprod(axis=0, *args, **kwargs)[source]
 
Cumulative product for each group.  Returns 
 Series or DataFrame
    See also  Series.groupby

Apply a function groupby to a Series.  DataFrame.groupby

Apply a function groupby to each row or column of a DataFrame.
pandas.core.groupby.GroupBy.cumsum   finalGroupBy.cumsum(axis=0, *args, **kwargs)[source]
 
Cumulative sum for each group.  Returns 
 Series or DataFrame
    See also  Series.groupby

Apply a function groupby to a Series.  DataFrame.groupby

Apply a function groupby to each row or column of a DataFrame.
pandas.core.groupby.GroupBy.ffill   finalGroupBy.ffill(limit=None)[source]
 
Forward fill the values.  Parameters 
 
limit:int, optional


Limit of how many values to fill.    Returns 
 Series or DataFrame

Object with missing values filled.      See also  Series.ffill

Returns Series with minimum number of char in object.  DataFrame.ffill

Object with missing values filled or None if inplace=True.  Series.fillna

Fill NaN values of a Series.  DataFrame.fillna

Fill NaN values of a DataFrame.
pandas.core.groupby.GroupBy.first   finalGroupBy.first(numeric_only=False, min_count=- 1)[source]
 
Compute first of group values.  Parameters 
 
numeric_only:bool, default False


Include only float, int, boolean columns. If None, will attempt to use everything, then use only numeric data.  
min_count:int, default -1


The required number of valid values to perform the operation. If fewer than min_count non-NA values are present the result will be NA.    Returns 
 Series or DataFrame

Computed first of values within each group.
pandas.core.groupby.GroupBy.get_group   GroupBy.get_group(name, obj=None)[source]
 
Construct DataFrame from group with provided name.  Parameters 
 
name:object


The name of the group to get as a DataFrame.  
obj:DataFrame, default None


The DataFrame to take the DataFrame out of. If it is None, the object groupby was called on will be used.    Returns 
 
group:same type as obj
pandas.core.groupby.GroupBy.groups   propertyGroupBy.groups
 
Dict {group name -> group labels}.
pandas.core.groupby.GroupBy.head   finalGroupBy.head(n=5)[source]
 
Return first n rows of each group. Similar to .apply(lambda x: x.head(n)), but it returns a subset of rows from the original DataFrame with original index and order preserved (as_index flag is ignored).  Parameters 
 
n:int


If positive: number of entries to include from start of each group. If negative: number of entries to exclude from end of each group.    Returns 
 Series or DataFrame

Subset of original Series or DataFrame as determined by n.      See also  Series.groupby

Apply a function groupby to a Series.  DataFrame.groupby

Apply a function groupby to each row or column of a DataFrame.    Examples 
>>> df = pd.DataFrame([[1, 2], [1, 4], [5, 6]],
...                   columns=['A', 'B'])
>>> df.groupby('A').head(1)
   A  B
0  1  2
2  5  6
>>> df.groupby('A').head(-1)
   A  B
0  1  2
pandas.core.groupby.GroupBy.indices   propertyGroupBy.indices
 
Dict {group name -> group indices}.
pandas.core.groupby.GroupBy.last   finalGroupBy.last(numeric_only=False, min_count=- 1)[source]
 
Compute last of group values.  Parameters 
 
numeric_only:bool, default False


Include only float, int, boolean columns. If None, will attempt to use everything, then use only numeric data.  
min_count:int, default -1


The required number of valid values to perform the operation. If fewer than min_count non-NA values are present the result will be NA.    Returns 
 Series or DataFrame

Computed last of values within each group.
pandas.core.groupby.GroupBy.max   finalGroupBy.max(numeric_only=False, min_count=- 1)[source]
 
Compute max of group values.  Parameters 
 
numeric_only:bool, default False


Include only float, int, boolean columns. If None, will attempt to use everything, then use only numeric data.  
min_count:int, default -1


The required number of valid values to perform the operation. If fewer than min_count non-NA values are present the result will be NA.    Returns 
 Series or DataFrame

Computed max of values within each group.