neulab/docprompting-conala huggingface dataset:
pandas.Series.pct_change   Series.pct_change(periods=1, fill_method='pad', limit=None, freq=None, **kwargs)[source]
 
Percentage change between the current and a prior element. Computes the percentage change from the immediately previous row by default. This is useful in comparing the percentage of change in a time series of elements.  Parameters 
 
periods:int, default 1


Periods to shift for forming percent change.  
fill_method:str, default ‘pad’


How to handle NAs before computing percent changes.  
limit:int, default None


The number of consecutive NAs to fill before stopping.  
freq:DateOffset, timedelta, or str, optional


Increment to use from time series API (e.g. ‘M’ or BDay()).  **kwargs

Additional keyword arguments are passed into DataFrame.shift or Series.shift.    Returns 
 
chg:Series or DataFrame


The same type as the calling object.      See also  Series.diff

Compute the difference of two elements in a Series.  DataFrame.diff

Compute the difference of two elements in a DataFrame.  Series.shift

Shift the index by some number of periods.  DataFrame.shift

Shift the index by some number of periods.    Examples Series 
>>> s = pd.Series([90, 91, 85])
>>> s
0    90
1    91
2    85
dtype: int64
  
>>> s.pct_change()
0         NaN
1    0.011111
2   -0.065934
dtype: float64
  
>>> s.pct_change(periods=2)
0         NaN
1         NaN
2   -0.055556
dtype: float64
  See the percentage change in a Series where filling NAs with last valid observation forward to next valid. 
>>> s = pd.Series([90, 91, None, 85])
>>> s
0    90.0
1    91.0
2     NaN
3    85.0
dtype: float64
  
>>> s.pct_change(fill_method='ffill')
0         NaN
1    0.011111
2    0.000000
3   -0.065934
dtype: float64
  DataFrame Percentage change in French franc, Deutsche Mark, and Italian lira from 1980-01-01 to 1980-03-01. 
>>> df = pd.DataFrame({
...     'FR': [4.0405, 4.0963, 4.3149],
...     'GR': [1.7246, 1.7482, 1.8519],
...     'IT': [804.74, 810.01, 860.13]},
...     index=['1980-01-01', '1980-02-01', '1980-03-01'])
>>> df
                FR      GR      IT
1980-01-01  4.0405  1.7246  804.74
1980-02-01  4.0963  1.7482  810.01
1980-03-01  4.3149  1.8519  860.13
  
>>> df.pct_change()
                  FR        GR        IT
1980-01-01       NaN       NaN       NaN
1980-02-01  0.013810  0.013684  0.006549
1980-03-01  0.053365  0.059318  0.061876
  Percentage of change in GOOG and APPL stock volume. Shows computing the percentage change between columns. 
>>> df = pd.DataFrame({
...     '2016': [1769950, 30586265],
...     '2015': [1500923, 40912316],
...     '2014': [1371819, 41403351]},
...     index=['GOOG', 'APPL'])
>>> df
          2016      2015      2014
GOOG   1769950   1500923   1371819
APPL  30586265  40912316  41403351
  
>>> df.pct_change(axis='columns', periods=-1)
          2016      2015  2014
GOOG  0.179241  0.094112   NaN
APPL -0.252395 -0.011860   NaN
pandas.Series.pipe   Series.pipe(func, *args, **kwargs)[source]
 
Apply chainable functions that expect Series or DataFrames.  Parameters 
 
func:function


Function to apply to the Series/DataFrame. args, and kwargs are passed into func. Alternatively a (callable, data_keyword) tuple where data_keyword is a string indicating the keyword of callable that expects the Series/DataFrame.  
args:iterable, optional


Positional arguments passed into func.  
kwargs:mapping, optional


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

    See also  DataFrame.apply

Apply a function along input axis of DataFrame.  DataFrame.applymap

Apply a function elementwise on a whole DataFrame.  Series.map

Apply a mapping correspondence on a Series.    Notes Use .pipe when chaining together functions that expect Series, DataFrames or GroupBy objects. Instead of writing 
>>> func(g(h(df), arg1=a), arg2=b, arg3=c)  
  You can write 
>>> (df.pipe(h)
...    .pipe(g, arg1=a)
...    .pipe(func, arg2=b, arg3=c)
... )  
  If you have a function that takes the data as (say) the second argument, pass a tuple indicating which keyword expects the data. For example, suppose f takes its data as arg2: 
>>> (df.pipe(h)
...    .pipe(g, arg1=a)
...    .pipe((func, 'arg2'), arg1=a, arg3=c)
...  )
pandas.Series.plot.area   Series.plot.area(x=None, y=None, **kwargs)[source]
 
Draw a stacked area plot. An area plot displays quantitative data visually. This function wraps the matplotlib area function.  Parameters 
 
x:label or position, optional


Coordinates for the X axis. By default uses the index.  
y:label or position, optional


Column to plot. By default uses all columns.  
stacked:bool, default True


Area plots are stacked by default. Set to False to create a unstacked plot.  **kwargs

Additional keyword arguments are documented in DataFrame.plot().    Returns 
 matplotlib.axes.Axes or numpy.ndarray

Area plot, or array of area plots if subplots is True.      See also  DataFrame.plot

Make plots of DataFrame using matplotlib / pylab.    Examples Draw an area plot based on basic business metrics: 
>>> df = pd.DataFrame({
...     'sales': [3, 2, 3, 9, 10, 6],
...     'signups': [5, 5, 6, 12, 14, 13],
...     'visits': [20, 42, 28, 62, 81, 50],
... }, index=pd.date_range(start='2018/01/01', end='2018/07/01',
...                        freq='M'))
>>> ax = df.plot.area()
     Area plots are stacked by default. To produce an unstacked plot, pass stacked=False: 
>>> ax = df.plot.area(stacked=False)
     Draw an area plot for a single column: 
>>> ax = df.plot.area(y='sales')
     Draw with a different x: 
>>> df = pd.DataFrame({
...     'sales': [3, 2, 3],
...     'visits': [20, 42, 28],
...     'day': [1, 2, 3],
... })
>>> ax = df.plot.area(x='day')
pandas.Series.plot.bar   Series.plot.bar(x=None, y=None, **kwargs)[source]
 
Vertical bar plot. A bar plot is a plot that presents categorical data with rectangular bars with lengths proportional to the values that they represent. A bar plot shows comparisons among discrete categories. One axis of the plot shows the specific categories being compared, and the other axis represents a measured value.  Parameters 
 
x:label or position, optional


Allows plotting of one column versus another. If not specified, the index of the DataFrame is used.  
y:label or position, optional


Allows plotting of one column versus another. If not specified, all numerical columns are used.  
color:str, array-like, or dict, optional


The color for each of the DataFrame’s columns. Possible values are:  
 A single color string referred to by name, RGB or RGBA code,

for instance ‘red’ or ‘#a98d19’.    
 A sequence of color strings referred to by name, RGB or RGBA

code, which will be used for each column recursively. For instance [‘green’,’yellow’] each column’s bar will be filled in green or yellow, alternatively. If there is only a single column to be plotted, then only the first color from the color list will be used.    
 A dict of the form {column name:color}, so that each column will be


colored accordingly. For example, if your columns are called a and b, then passing {‘a’: ‘green’, ‘b’: ‘red’} will color bars for column a in green and bars for column b in red.      New in version 1.1.0.   **kwargs

Additional keyword arguments are documented in DataFrame.plot().    Returns 
 matplotlib.axes.Axes or np.ndarray of them

An ndarray is returned with one matplotlib.axes.Axes per column when subplots=True.      See also  DataFrame.plot.barh

Horizontal bar plot.  DataFrame.plot

Make plots of a DataFrame.  matplotlib.pyplot.bar

Make a bar plot with matplotlib.    Examples Basic plot. 
>>> df = pd.DataFrame({'lab':['A', 'B', 'C'], 'val':[10, 30, 20]})
>>> ax = df.plot.bar(x='lab', y='val', rot=0)
     Plot a whole dataframe to a bar plot. Each column is assigned a distinct color, and each row is nested in a group along the horizontal axis. 
>>> speed = [0.1, 17.5, 40, 48, 52, 69, 88]
>>> lifespan = [2, 8, 70, 1.5, 25, 12, 28]
>>> index = ['snail', 'pig', 'elephant',
...          'rabbit', 'giraffe', 'coyote', 'horse']
>>> df = pd.DataFrame({'speed': speed,
...                    'lifespan': lifespan}, index=index)
>>> ax = df.plot.bar(rot=0)
     Plot stacked bar charts for the DataFrame 
>>> ax = df.plot.bar(stacked=True)
     Instead of nesting, the figure can be split by column with subplots=True. In this case, a numpy.ndarray of matplotlib.axes.Axes are returned. 
>>> axes = df.plot.bar(rot=0, subplots=True)
>>> axes[1].legend(loc=2)  
     If you don’t like the default colours, you can specify how you’d like each column to be colored. 
>>> axes = df.plot.bar(
...     rot=0, subplots=True, color={"speed": "red", "lifespan": "green"}
... )
>>> axes[1].legend(loc=2)  
     Plot a single column. 
>>> ax = df.plot.bar(y='speed', rot=0)
     Plot only selected categories for the DataFrame. 
>>> ax = df.plot.bar(x='lifespan', rot=0)
pandas.Series.plot.box   Series.plot.box(by=None, **kwargs)[source]
 
Make a box plot of the DataFrame columns. A box plot is a method for graphically depicting groups of numerical data through their quartiles. The box extends from the Q1 to Q3 quartile values of the data, with a line at the median (Q2). The whiskers extend from the edges of box to show the range of the data. The position of the whiskers is set by default to 1.5*IQR (IQR = Q3 - Q1) from the edges of the box. Outlier points are those past the end of the whiskers. For further details see Wikipedia’s entry for boxplot. A consideration when using this chart is that the box and the whiskers can overlap, which is very common when plotting small sets of data.  Parameters 
 
by:str or sequence


Column in the DataFrame to group by.  Changed in version 1.4.0: Previously, by is silently ignore and makes no groupings   **kwargs

Additional keywords are documented in DataFrame.plot().    Returns 
 
matplotlib.axes.Axes or numpy.ndarray of them
    See also  DataFrame.boxplot

Another method to draw a box plot.  Series.plot.box

Draw a box plot from a Series object.  matplotlib.pyplot.boxplot

Draw a box plot in matplotlib.    Examples Draw a box plot from a DataFrame with four columns of randomly generated data. 
>>> data = np.random.randn(25, 4)
>>> df = pd.DataFrame(data, columns=list('ABCD'))
>>> ax = df.plot.box()
     You can also generate groupings if you specify the by parameter (which can take a column name, or a list or tuple of column names):  Changed in version 1.4.0.  
>>> age_list = [8, 10, 12, 14, 72, 74, 76, 78, 20, 25, 30, 35, 60, 85]
>>> df = pd.DataFrame({"gender": list("MMMMMMMMFFFFFF"), "age": age_list})
>>> ax = df.plot.box(column="age", by="gender", figsize=(10, 8))
pandas.Series.plot.density   Series.plot.density(bw_method=None, ind=None, **kwargs)[source]
 
Generate Kernel Density Estimate plot using Gaussian kernels. In statistics, kernel density estimation (KDE) is a non-parametric way to estimate the probability density function (PDF) of a random variable. This function uses Gaussian kernels and includes automatic bandwidth determination.  Parameters 
 
bw_method:str, scalar or callable, optional


The method used to calculate the estimator bandwidth. This can be ‘scott’, ‘silverman’, a scalar constant or a callable. If None (default), ‘scott’ is used. See scipy.stats.gaussian_kde for more information.  
ind:NumPy array or int, optional


Evaluation points for the estimated PDF. If None (default), 1000 equally spaced points are used. If ind is a NumPy array, the KDE is evaluated at the points passed. If ind is an integer, ind number of equally spaced points are used.  **kwargs

Additional keyword arguments are documented in pandas.%(this-datatype)s.plot().    Returns 
 matplotlib.axes.Axes or numpy.ndarray of them
    See also  scipy.stats.gaussian_kde

Representation of a kernel-density estimate using Gaussian kernels. This is the function used internally to estimate the PDF.    Examples Given a Series of points randomly sampled from an unknown distribution, estimate its PDF using KDE with automatic bandwidth determination and plot the results, evaluating them at 1000 equally spaced points (default): 
>>> s = pd.Series([1, 2, 2.5, 3, 3.5, 4, 5])
>>> ax = s.plot.kde()
     A scalar bandwidth can be specified. Using a small bandwidth value can lead to over-fitting, while using a large bandwidth value may result in under-fitting: 
>>> ax = s.plot.kde(bw_method=0.3)
     
>>> ax = s.plot.kde(bw_method=3)
     Finally, the ind parameter determines the evaluation points for the plot of the estimated PDF: 
>>> ax = s.plot.kde(ind=[1, 2, 3, 4, 5])
     For DataFrame, it works in the same way: 
>>> df = pd.DataFrame({
...     'x': [1, 2, 2.5, 3, 3.5, 4, 5],
...     'y': [4, 4, 4.5, 5, 5.5, 6, 6],
... })
>>> ax = df.plot.kde()
     A scalar bandwidth can be specified. Using a small bandwidth value can lead to over-fitting, while using a large bandwidth value may result in under-fitting: 
>>> ax = df.plot.kde(bw_method=0.3)
     
>>> ax = df.plot.kde(bw_method=3)
     Finally, the ind parameter determines the evaluation points for the plot of the estimated PDF: 
>>> ax = df.plot.kde(ind=[1, 2, 3, 4, 5, 6])
pandas.Series.plot.hist   Series.plot.hist(by=None, bins=10, **kwargs)[source]
 
Draw one histogram of the DataFrame’s columns. A histogram is a representation of the distribution of data. This function groups the values of all given Series in the DataFrame into bins and draws all bins in one matplotlib.axes.Axes. This is useful when the DataFrame’s Series are in a similar scale.  Parameters 
 
by:str or sequence, optional


Column in the DataFrame to group by.  Changed in version 1.4.0: Previously, by is silently ignore and makes no groupings   
bins:int, default 10


Number of histogram bins to be used.  **kwargs

Additional keyword arguments are documented in DataFrame.plot().    Returns 
 class:matplotlib.AxesSubplot


Return a histogram plot.      See also  DataFrame.hist

Draw histograms per DataFrame’s Series.  Series.hist

Draw a histogram with Series’ data.    Examples When we roll a die 6000 times, we expect to get each value around 1000 times. But when we roll two dice and sum the result, the distribution is going to be quite different. A histogram illustrates those distributions. 
>>> df = pd.DataFrame(
...     np.random.randint(1, 7, 6000),
...     columns = ['one'])
>>> df['two'] = df['one'] + np.random.randint(1, 7, 6000)
>>> ax = df.plot.hist(bins=12, alpha=0.5)
     A grouped histogram can be generated by providing the parameter by (which can be a column name, or a list of column names): 
>>> age_list = [8, 10, 12, 14, 72, 74, 76, 78, 20, 25, 30, 35, 60, 85]
>>> df = pd.DataFrame({"gender": list("MMMMMMMMFFFFFF"), "age": age_list})
>>> ax = df.plot.hist(column=["age"], by="gender", figsize=(10, 8))
pandas.Series.plot.kde   Series.plot.kde(bw_method=None, ind=None, **kwargs)[source]
 
Generate Kernel Density Estimate plot using Gaussian kernels. In statistics, kernel density estimation (KDE) is a non-parametric way to estimate the probability density function (PDF) of a random variable. This function uses Gaussian kernels and includes automatic bandwidth determination.  Parameters 
 
bw_method:str, scalar or callable, optional


The method used to calculate the estimator bandwidth. This can be ‘scott’, ‘silverman’, a scalar constant or a callable. If None (default), ‘scott’ is used. See scipy.stats.gaussian_kde for more information.  
ind:NumPy array or int, optional


Evaluation points for the estimated PDF. If None (default), 1000 equally spaced points are used. If ind is a NumPy array, the KDE is evaluated at the points passed. If ind is an integer, ind number of equally spaced points are used.  **kwargs

Additional keyword arguments are documented in pandas.%(this-datatype)s.plot().    Returns 
 matplotlib.axes.Axes or numpy.ndarray of them
    See also  scipy.stats.gaussian_kde

Representation of a kernel-density estimate using Gaussian kernels. This is the function used internally to estimate the PDF.    Examples Given a Series of points randomly sampled from an unknown distribution, estimate its PDF using KDE with automatic bandwidth determination and plot the results, evaluating them at 1000 equally spaced points (default): 
>>> s = pd.Series([1, 2, 2.5, 3, 3.5, 4, 5])
>>> ax = s.plot.kde()
     A scalar bandwidth can be specified. Using a small bandwidth value can lead to over-fitting, while using a large bandwidth value may result in under-fitting: 
>>> ax = s.plot.kde(bw_method=0.3)
     
>>> ax = s.plot.kde(bw_method=3)
     Finally, the ind parameter determines the evaluation points for the plot of the estimated PDF: 
>>> ax = s.plot.kde(ind=[1, 2, 3, 4, 5])
     For DataFrame, it works in the same way: 
>>> df = pd.DataFrame({
...     'x': [1, 2, 2.5, 3, 3.5, 4, 5],
...     'y': [4, 4, 4.5, 5, 5.5, 6, 6],
... })
>>> ax = df.plot.kde()
     A scalar bandwidth can be specified. Using a small bandwidth value can lead to over-fitting, while using a large bandwidth value may result in under-fitting: 
>>> ax = df.plot.kde(bw_method=0.3)
     
>>> ax = df.plot.kde(bw_method=3)
     Finally, the ind parameter determines the evaluation points for the plot of the estimated PDF: 
>>> ax = df.plot.kde(ind=[1, 2, 3, 4, 5, 6])
pandas.Series.plot.line   Series.plot.line(x=None, y=None, **kwargs)[source]
 
Plot Series or DataFrame as lines. This function is useful to plot lines using DataFrame’s values as coordinates.  Parameters 
 
x:label or position, optional


Allows plotting of one column versus another. If not specified, the index of the DataFrame is used.  
y:label or position, optional


Allows plotting of one column versus another. If not specified, all numerical columns are used.  
color:str, array-like, or dict, optional


The color for each of the DataFrame’s columns. Possible values are:  
 A single color string referred to by name, RGB or RGBA code,

for instance ‘red’ or ‘#a98d19’.    
 A sequence of color strings referred to by name, RGB or RGBA

code, which will be used for each column recursively. For instance [‘green’,’yellow’] each column’s line will be filled in green or yellow, alternatively. If there is only a single column to be plotted, then only the first color from the color list will be used.    
 A dict of the form {column name:color}, so that each column will be


colored accordingly. For example, if your columns are called a and b, then passing {‘a’: ‘green’, ‘b’: ‘red’} will color lines for column a in green and lines for column b in red.      New in version 1.1.0.   **kwargs

Additional keyword arguments are documented in DataFrame.plot().    Returns 
 matplotlib.axes.Axes or np.ndarray of them

An ndarray is returned with one matplotlib.axes.Axes per column when subplots=True.      See also  matplotlib.pyplot.plot

Plot y versus x as lines and/or markers.    Examples 
>>> s = pd.Series([1, 3, 2])
>>> s.plot.line()
<AxesSubplot:ylabel='Density'>
     The following example shows the populations for some animals over the years. 
>>> df = pd.DataFrame({
...    'pig': [20, 18, 489, 675, 1776],
...    'horse': [4, 25, 281, 600, 1900]
...    }, index=[1990, 1997, 2003, 2009, 2014])
>>> lines = df.plot.line()
     An example with subplots, so an array of axes is returned. 
>>> axes = df.plot.line(subplots=True)
>>> type(axes)
<class 'numpy.ndarray'>
     Let’s repeat the same example, but specifying colors for each column (in this case, for each animal). 
>>> axes = df.plot.line(
...     subplots=True, color={"pig": "pink", "horse": "#742802"}
... )
     The following example shows the relationship between both populations. 
>>> lines = df.plot.line(x='pig', y='horse')
pandas.Series.plot.pie   Series.plot.pie(**kwargs)[source]
 
Generate a pie plot. A pie plot is a proportional representation of the numerical data in a column. This function wraps matplotlib.pyplot.pie() for the specified column. If no column reference is passed and subplots=True a pie plot is drawn for each numerical column independently.  Parameters 
 
y:int or label, optional


Label or position of the column to plot. If not provided, subplots=True argument must be passed.  **kwargs

Keyword arguments to pass on to DataFrame.plot().    Returns 
 matplotlib.axes.Axes or np.ndarray of them

A NumPy array is returned when subplots is True.      See also  Series.plot.pie

Generate a pie plot for a Series.  DataFrame.plot

Make plots of a DataFrame.    Examples In the example below we have a DataFrame with the information about planet’s mass and radius. We pass the ‘mass’ column to the pie function to get a pie plot. 
>>> df = pd.DataFrame({'mass': [0.330, 4.87 , 5.97],
...                    'radius': [2439.7, 6051.8, 6378.1]},
...                   index=['Mercury', 'Venus', 'Earth'])
>>> plot = df.plot.pie(y='mass', figsize=(5, 5))
     
>>> plot = df.plot.pie(subplots=True, figsize=(11, 6))
pandas.Series.pop   Series.pop(item)[source]
 
Return item and drops from series. Raise KeyError if not found.  Parameters 
 
item:label


Index of the element that needs to be removed.    Returns 
 Value that is popped from series.
   Examples 
>>> ser = pd.Series([1,2,3])
  
>>> ser.pop(0)
1
  
>>> ser
1    2
2    3
dtype: int64
pandas.Series.pow   Series.pow(other, level=None, fill_value=None, axis=0)[source]
 
Return Exponential power of series and other, element-wise (binary operator pow). Equivalent to series ** other, but with support to substitute a fill_value for missing data in either one of the inputs.  Parameters 
 
other:Series or scalar value


fill_value:None or float value, default None (NaN)


Fill existing missing (NaN) values, and any new element needed for successful Series alignment, with this value before computation. If data in both corresponding Series locations is missing the result of filling (at that location) will be missing.  
level:int or name


Broadcast across a level, matching Index values on the passed MultiIndex level.    Returns 
 Series

The result of the operation.      See also  Series.rpow

Reverse of the Exponential power operator, see Python documentation for more details.    Examples 
>>> a = pd.Series([1, 1, 1, np.nan], index=['a', 'b', 'c', 'd'])
>>> a
a    1.0
b    1.0
c    1.0
d    NaN
dtype: float64
>>> b = pd.Series([1, np.nan, 1, np.nan], index=['a', 'b', 'd', 'e'])
>>> b
a    1.0
b    NaN
d    1.0
e    NaN
dtype: float64
>>> a.pow(b, fill_value=0)
a    1.0
b    1.0
c    1.0
d    0.0
e    NaN
dtype: float64
pandas.Series.prod   Series.prod(axis=None, skipna=True, level=None, numeric_only=None, min_count=0, **kwargs)[source]
 
Return the product of the values over the requested axis.  Parameters 
 
axis:{index (0)}


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 scalar.  
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.  
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.  **kwargs

Additional keyword arguments to be passed to the function.    Returns 
 scalar or Series (if level specified)
    See also  Series.sum

Return the sum.  Series.min

Return the minimum.  Series.max

Return the maximum.  Series.idxmin

Return the index of the minimum.  Series.idxmax

Return the index of the maximum.  DataFrame.sum

Return the sum over the requested axis.  DataFrame.min

Return the minimum over the requested axis.  DataFrame.max

Return the maximum over the requested axis.  DataFrame.idxmin

Return the index of the minimum over the requested axis.  DataFrame.idxmax

Return the index of the maximum over the requested axis.    Examples By default, the product of an empty or all-NA Series is 1 
>>> pd.Series([], dtype="float64").prod()
1.0
  This can be controlled with the min_count parameter 
>>> pd.Series([], dtype="float64").prod(min_count=1)
nan
  Thanks to the skipna parameter, min_count handles all-NA and empty series identically. 
>>> pd.Series([np.nan]).prod()
1.0
  
>>> pd.Series([np.nan]).prod(min_count=1)
nan