neulab/docprompting-conala huggingface dataset:
pandas.core.groupby.GroupBy.mean   finalGroupBy.mean(numeric_only=NoDefault.no_default, engine='cython', engine_kwargs=None)[source]
 
Compute mean of groups, excluding missing values.  Parameters 
 
numeric_only:bool, default True


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


 'cython' : Runs the operation through C-extensions from cython. 'numba' : Runs the operation through JIT compiled code from numba. None : Defaults to 'cython' or globally setting compute.use_numba   New in version 1.4.0.   
engine_kwargs:dict, default None


 For 'cython' engine, there are no accepted engine_kwargs For 'numba' engine, the engine can accept nopython, nogil and parallel dictionary keys. The values must either be True or False. The default engine_kwargs for the 'numba' engine is {{'nopython': True, 'nogil': False, 'parallel': False}}   New in version 1.4.0.     Returns 
 pandas.Series or pandas.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.    Examples 
>>> df = pd.DataFrame({'A': [1, 1, 2, 1, 2],
...                    'B': [np.nan, 2, 3, 4, 5],
...                    'C': [1, 2, 1, 1, 2]}, columns=['A', 'B', 'C'])
  Groupby one column and return the mean of the remaining columns in each group. 
>>> df.groupby('A').mean()
     B         C
A
1  3.0  1.333333
2  4.0  1.500000
  Groupby two columns and return the mean of the remaining column. 
>>> df.groupby(['A', 'B']).mean()
         C
A B
1 2.0  2.0
  4.0  1.0
2 3.0  1.0
  5.0  2.0
  Groupby one column and return the mean of only particular column in the group. 
>>> df.groupby('A')['B'].mean()
A
1    3.0
2    4.0
Name: B, dtype: float64
pandas.core.groupby.GroupBy.median   finalGroupBy.median(numeric_only=NoDefault.no_default)[source]
 
Compute median of groups, excluding missing values. For multiple groupings, the result index will be a MultiIndex  Parameters 
 
numeric_only:bool, default True


Include only float, int, boolean columns. If None, will attempt to use everything, then use only numeric data.    Returns 
 Series or DataFrame

Median 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.min   finalGroupBy.min(numeric_only=False, min_count=- 1)[source]
 
Compute min 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 min of values within each group.
pandas.core.groupby.GroupBy.ngroup   finalGroupBy.ngroup(ascending=True)[source]
 
Number each group from 0 to the number of groups - 1. This is the enumerative complement of cumcount. Note that the numbers given to the groups match the order in which the groups would be seen when iterating over the groupby object, not the order they are first observed.  Parameters 
 
ascending:bool, default True


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

Unique numbers for each group.      See also  cumcount

Number the rows in each group.    Examples 
>>> df = pd.DataFrame({"A": list("aaabba")})
>>> df
   A
0  a
1  a
2  a
3  b
4  b
5  a
>>> df.groupby('A').ngroup()
0    0
1    0
2    0
3    1
4    1
5    0
dtype: int64
>>> df.groupby('A').ngroup(ascending=False)
0    1
1    1
2    1
3    0
4    0
5    1
dtype: int64
>>> df.groupby(["A", [1,1,2,3,2,1]]).ngroup()
0    0
1    0
2    1
3    3
4    2
5    0
dtype: int64
pandas.core.groupby.GroupBy.nth   finalGroupBy.nth(n, dropna=None)[source]
 
Take the nth row from each group if n is an int, otherwise a subset of rows. Can be either a call or an index. dropna is not available with index notation. Index notation accepts a comma separated list of integers and slices. If dropna, will take the nth non-null row, dropna is either ‘all’ or ‘any’; this is equivalent to calling dropna(how=dropna) before the groupby.  Parameters 
 
n:int, slice or list of ints and slices


A single nth value for the row or a list of nth values or slices.  Changed in version 1.4.0: Added slice and lists containiing slices. Added index notation.   
dropna:{‘any’, ‘all’, None}, default None


Apply the specified dropna operation before counting which row is the nth row. Only supported if n is an int.    Returns 
 Series or DataFrame

N-th value 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({'A': [1, 1, 2, 1, 2],
...                    'B': [np.nan, 2, 3, 4, 5]}, columns=['A', 'B'])
>>> g = df.groupby('A')
>>> g.nth(0)
     B
A
1  NaN
2  3.0
>>> g.nth(1)
     B
A
1  2.0
2  5.0
>>> g.nth(-1)
     B
A
1  4.0
2  5.0
>>> g.nth([0, 1])
     B
A
1  NaN
1  2.0
2  3.0
2  5.0
>>> g.nth(slice(None, -1))
     B
A
1  NaN
1  2.0
2  3.0
  Index notation may also be used 
>>> g.nth[0, 1]
     B
A
1  NaN
1  2.0
2  3.0
2  5.0
>>> g.nth[:-1]
     B
A
1  NaN
1  2.0
2  3.0
  Specifying dropna allows count ignoring NaN 
>>> g.nth(0, dropna='any')
     B
A
1  2.0
2  3.0
  NaNs denote group exhausted when using dropna 
>>> g.nth(3, dropna='any')
    B
A
1 NaN
2 NaN
  Specifying as_index=False in groupby keeps the original index. 
>>> df.groupby('A', as_index=False).nth(1)
   A    B
1  1  2.0
4  2  5.0
pandas.core.groupby.GroupBy.ohlc   finalGroupBy.ohlc()[source]
 
Compute open, high, low and close values of a group, excluding missing values. For multiple groupings, the result index will be a MultiIndex  Returns 
 DataFrame

Open, high, low and close 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.pad   GroupBy.pad(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.pct_change   finalGroupBy.pct_change(periods=1, fill_method='ffill', limit=None, freq=None, axis=0)[source]
 
Calculate pct_change of each value to previous entry in group.  Returns 
 Series or DataFrame

Percentage changes 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.pipe   GroupBy.pipe(func, *args, **kwargs)[source]
 
Apply a function func with arguments to this GroupBy object and return the function’s result. Use .pipe when you want to improve readability by chaining together functions that expect Series, DataFrames, GroupBy or Resampler objects. Instead of writing 
>>> h(g(f(df.groupby('group')), arg1=a), arg2=b, arg3=c)  
  You can write 
>>> (df.groupby('group')
...    .pipe(f)
...    .pipe(g, arg1=a)
...    .pipe(h, arg2=b, arg3=c))  
  which is much more readable.  Parameters 
 
func:callable or tuple of (callable, str)


Function to apply to this GroupBy object or, alternatively, a (callable, data_keyword) tuple where data_keyword is a string indicating the keyword of callable that expects the GroupBy object.  
args:iterable, optional


Positional arguments passed into func.  
kwargs:dict, optional


A dictionary of keyword arguments passed into func.    Returns 
 
object:the return type of func.

    See also  Series.pipe

Apply a function with arguments to a series.  DataFrame.pipe

Apply a function with arguments to a dataframe.  apply

Apply function to each group instead of to the full GroupBy object.    Notes See more here Examples 
>>> df = pd.DataFrame({'A': 'a b a b'.split(), 'B': [1, 2, 3, 4]})
>>> df
   A  B
0  a  1
1  b  2
2  a  3
3  b  4
  To get the difference between each groups maximum and minimum value in one pass, you can do 
>>> df.groupby('A').pipe(lambda x: x.max() - x.min())
   B
A
a  2
b  2
pandas.core.groupby.GroupBy.prod   finalGroupBy.prod(numeric_only=NoDefault.no_default, min_count=0)[source]
 
Compute prod of group values.  Parameters 
 
numeric_only:bool, default True


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


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 prod of values within each group.
pandas.core.groupby.GroupBy.rank   finalGroupBy.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.GroupBy.sem   finalGroupBy.sem(ddof=1)[source]
 
Compute standard error of the mean of groups, excluding missing values. For multiple groupings, the result index will be a MultiIndex.  Parameters 
 
ddof:int, default 1


Degrees of freedom.    Returns 
 Series or DataFrame

Standard error of the mean 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.size   finalGroupBy.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.GroupBy.std   finalGroupBy.std(ddof=1, engine=None, engine_kwargs=None)[source]
 
Compute standard deviation of groups, excluding missing values. For multiple groupings, the result index will be a MultiIndex.  Parameters 
 
ddof:int, default 1


Degrees of freedom.  
engine:str, default None


 'cython' : Runs the operation through C-extensions from cython. 'numba' : Runs the operation through JIT compiled code from numba. None : Defaults to 'cython' or globally setting compute.use_numba   New in version 1.4.0.   
engine_kwargs:dict, default None


 For 'cython' engine, there are no accepted engine_kwargs For 'numba' engine, the engine can accept nopython, nogil and parallel dictionary keys. The values must either be True or False. The default engine_kwargs for the 'numba' engine is {{'nopython': True, 'nogil': False, 'parallel': False}}   New in version 1.4.0.     Returns 
 Series or DataFrame

Standard deviation 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.sum   finalGroupBy.sum(numeric_only=NoDefault.no_default, min_count=0, engine=None, engine_kwargs=None)[source]
 
Compute sum of group values.  Parameters 
 
numeric_only:bool, default True


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


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 sum of values within each group.
pandas.core.groupby.GroupBy.tail   finalGroupBy.tail(n=5)[source]
 
Return last n rows of each group. Similar to .apply(lambda x: x.tail(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 end of each group. If negative: number of entries to exclude from start 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([['a', 1], ['a', 2], ['b', 1], ['b', 2]],
...                   columns=['A', 'B'])
>>> df.groupby('A').tail(1)
   A  B
1  a  2
3  b  2
>>> df.groupby('A').tail(-1)
   A  B
1  a  2
3  b  2
pandas.core.groupby.GroupBy.var   finalGroupBy.var(ddof=1, engine=None, engine_kwargs=None)[source]
 
Compute variance of groups, excluding missing values. For multiple groupings, the result index will be a MultiIndex.  Parameters 
 
ddof:int, default 1


Degrees of freedom.  
engine:str, default None


 'cython' : Runs the operation through C-extensions from cython. 'numba' : Runs the operation through JIT compiled code from numba. None : Defaults to 'cython' or globally setting compute.use_numba   New in version 1.4.0.   
engine_kwargs:dict, default None


 For 'cython' engine, there are no accepted engine_kwargs For 'numba' engine, the engine can accept nopython, nogil and parallel dictionary keys. The values must either be True or False. The default engine_kwargs for the 'numba' engine is {{'nopython': True, 'nogil': False, 'parallel': False}}   New in version 1.4.0.     Returns 
 Series or DataFrame

Variance 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.SeriesGroupBy.hist   propertySeriesGroupBy.hist
 
Draw histogram of the input series using matplotlib.  Parameters 
 
by:object, optional


If passed, then used to form histograms for separate groups.  
ax:matplotlib axis object


If not passed, uses gca().  
grid:bool, default True


Whether to show axis grid lines.  
xlabelsize:int, default None


If specified changes the x-axis label size.  
xrot:float, default None


Rotation of x axis labels.  
ylabelsize:int, default None


If specified changes the y-axis label size.  
yrot:float, default None


Rotation of y axis labels.  
figsize:tuple, default None


Figure size in inches by default.  
bins:int or sequence, default 10


Number of histogram bins to be used. If an integer is given, bins + 1 bin edges are calculated and returned. If bins is a sequence, gives bin edges, including left edge of first bin and right edge of last bin. In this case, bins is returned unmodified.  
backend:str, default None


Backend to use instead of the backend specified in the option plotting.backend. For instance, ‘matplotlib’. Alternatively, to specify the plotting.backend for the whole session, set pd.options.plotting.backend.  New in version 1.0.0.   
legend:bool, default False


Whether to show the legend.  New in version 1.1.0.   **kwargs

To be passed to the actual plotting function.    Returns 
 matplotlib.AxesSubplot

A histogram plot.      See also  matplotlib.axes.Axes.hist

Plot a histogram using matplotlib.
pandas.core.groupby.SeriesGroupBy.is_monotonic_decreasing   propertySeriesGroupBy.is_monotonic_decreasing
 
Return boolean if values in the object are monotonic_decreasing.  Returns 
 bool
pandas.core.groupby.SeriesGroupBy.is_monotonic_increasing   propertySeriesGroupBy.is_monotonic_increasing
 
Alias for is_monotonic.
pandas.core.groupby.SeriesGroupBy.nlargest   SeriesGroupBy.nlargest(n=5, keep='first')[source]
 
Return the largest n elements.  Parameters 
 
n:int, default 5


Return this many descending sorted values.  
keep:{‘first’, ‘last’, ‘all’}, default ‘first’


When there are duplicate values that cannot all fit in a Series of n elements:  first : return the first n occurrences in order of appearance. last : return the last n occurrences in reverse order of appearance. all : keep all occurrences. This can result in a Series of size larger than n.     Returns 
 Series

The n largest values in the Series, sorted in decreasing order.      See also  Series.nsmallest

Get the n smallest elements.  Series.sort_values

Sort Series by values.  Series.head

Return the first n rows.    Notes Faster than .sort_values(ascending=False).head(n) for small n relative to the size of the Series object. Examples 
>>> countries_population = {"Italy": 59000000, "France": 65000000,
...                         "Malta": 434000, "Maldives": 434000,
...                         "Brunei": 434000, "Iceland": 337000,
...                         "Nauru": 11300, "Tuvalu": 11300,
...                         "Anguilla": 11300, "Montserrat": 5200}
>>> s = pd.Series(countries_population)
>>> s
Italy       59000000
France      65000000
Malta         434000
Maldives      434000
Brunei        434000
Iceland       337000
Nauru          11300
Tuvalu         11300
Anguilla       11300
Montserrat      5200
dtype: int64
  The n largest elements where n=5 by default. 
>>> s.nlargest()
France      65000000
Italy       59000000
Malta         434000
Maldives      434000
Brunei        434000
dtype: int64
  The n largest elements where n=3. Default keep value is ‘first’ so Malta will be kept. 
>>> s.nlargest(3)
France    65000000
Italy     59000000
Malta       434000
dtype: int64
  The n largest elements where n=3 and keeping the last duplicates. Brunei will be kept since it is the last with value 434000 based on the index order. 
>>> s.nlargest(3, keep='last')
France      65000000
Italy       59000000
Brunei        434000
dtype: int64
  The n largest elements where n=3 with all duplicates kept. Note that the returned Series has five elements due to the three duplicates. 
>>> s.nlargest(3, keep='all')
France      65000000
Italy       59000000
Malta         434000
Maldives      434000
Brunei        434000
dtype: int64
pandas.core.groupby.SeriesGroupBy.nsmallest   SeriesGroupBy.nsmallest(n=5, keep='first')[source]
 
Return the smallest n elements.  Parameters 
 
n:int, default 5


Return this many ascending sorted values.  
keep:{‘first’, ‘last’, ‘all’}, default ‘first’


When there are duplicate values that cannot all fit in a Series of n elements:  first : return the first n occurrences in order of appearance. last : return the last n occurrences in reverse order of appearance. all : keep all occurrences. This can result in a Series of size larger than n.     Returns 
 Series

The n smallest values in the Series, sorted in increasing order.      See also  Series.nlargest

Get the n largest elements.  Series.sort_values

Sort Series by values.  Series.head

Return the first n rows.    Notes Faster than .sort_values().head(n) for small n relative to the size of the Series object. Examples 
>>> countries_population = {"Italy": 59000000, "France": 65000000,
...                         "Brunei": 434000, "Malta": 434000,
...                         "Maldives": 434000, "Iceland": 337000,
...                         "Nauru": 11300, "Tuvalu": 11300,
...                         "Anguilla": 11300, "Montserrat": 5200}
>>> s = pd.Series(countries_population)
>>> s
Italy       59000000
France      65000000
Brunei        434000
Malta         434000
Maldives      434000
Iceland       337000
Nauru          11300
Tuvalu         11300
Anguilla       11300
Montserrat      5200
dtype: int64
  The n smallest elements where n=5 by default. 
>>> s.nsmallest()
Montserrat    5200
Nauru        11300
Tuvalu       11300
Anguilla     11300
Iceland     337000
dtype: int64
  The n smallest elements where n=3. Default keep value is ‘first’ so Nauru and Tuvalu will be kept. 
>>> s.nsmallest(3)
Montserrat   5200
Nauru       11300
Tuvalu      11300
dtype: int64
  The n smallest elements where n=3 and keeping the last duplicates. Anguilla and Tuvalu will be kept since they are the last with value 11300 based on the index order. 
>>> s.nsmallest(3, keep='last')
Montserrat   5200
Anguilla    11300
Tuvalu      11300
dtype: int64
  The n smallest elements where n=3 with all duplicates kept. Note that the returned Series has four elements due to the three duplicates. 
>>> s.nsmallest(3, keep='all')
Montserrat   5200
Nauru       11300
Tuvalu      11300
Anguilla    11300
dtype: int64
pandas.core.groupby.SeriesGroupBy.nunique   SeriesGroupBy.nunique(dropna=True)[source]
 
Return number of unique elements in the group.  Returns 
 Series

Number of unique values within each group.
pandas.core.groupby.SeriesGroupBy.unique   propertySeriesGroupBy.unique
 
Return unique values of Series object. Uniques are returned in order of appearance. Hash table-based unique, therefore does NOT sort.  Returns 
 ndarray or ExtensionArray

The unique values returned as a NumPy array. See Notes.      See also  unique

Top-level unique method for any 1-d array-like object.  Index.unique

Return Index with unique values from an Index object.    Notes Returns the unique values as a NumPy array. In case of an extension-array backed Series, a new ExtensionArray of that type with just the unique values is returned. This includes  
 Categorical Period Datetime with Timezone Interval Sparse IntegerNA  
 See Examples section. Examples 
>>> pd.Series([2, 1, 3, 3], name='A').unique()
array([2, 1, 3])
  
>>> pd.Series([pd.Timestamp('2016-01-01') for _ in range(3)]).unique()
array(['2016-01-01T00:00:00.000000000'], dtype='datetime64[ns]')
  
>>> pd.Series([pd.Timestamp('2016-01-01', tz='US/Eastern')
...            for _ in range(3)]).unique()
<DatetimeArray>
['2016-01-01 00:00:00-05:00']
Length: 1, dtype: datetime64[ns, US/Eastern]
  An Categorical will return categories in the order of appearance and with the same dtype. 
>>> pd.Series(pd.Categorical(list('baabc'))).unique()
['b', 'a', 'c']
Categories (3, object): ['a', 'b', 'c']
>>> pd.Series(pd.Categorical(list('baabc'), categories=list('abc'),
...                          ordered=True)).unique()
['b', 'a', 'c']
Categories (3, object): ['a' < 'b' < 'c']