neulab/docprompting-conala huggingface dataset:
pandas.DataFrame.plot.box   DataFrame.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.DataFrame.plot.density   DataFrame.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.DataFrame.plot.hexbin   DataFrame.plot.hexbin(x, y, C=None, reduce_C_function=None, gridsize=None, **kwargs)[source]
 
Generate a hexagonal binning plot. Generate a hexagonal binning plot of x versus y. If C is None (the default), this is a histogram of the number of occurrences of the observations at (x[i], y[i]). If C is specified, specifies values at given coordinates (x[i], y[i]). These values are accumulated for each hexagonal bin and then reduced according to reduce_C_function, having as default the NumPy’s mean function (numpy.mean()). (If C is specified, it must also be a 1-D sequence of the same length as x and y, or a column label.)  Parameters 
 
x:int or str


The column label or position for x points.  
y:int or str


The column label or position for y points.  
C:int or str, optional


The column label or position for the value of (x, y) point.  
reduce_C_function:callable, default np.mean


Function of one argument that reduces all the values in a bin to a single number (e.g. np.mean, np.max, np.sum, np.std).  
gridsize:int or tuple of (int, int), default 100


The number of hexagons in the x-direction. The corresponding number of hexagons in the y-direction is chosen in a way that the hexagons are approximately regular. Alternatively, gridsize can be a tuple with two elements specifying the number of hexagons in the x-direction and the y-direction.  **kwargs

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

The matplotlib Axes on which the hexbin is plotted.      See also  DataFrame.plot

Make plots of a DataFrame.  matplotlib.pyplot.hexbin

Hexagonal binning plot using matplotlib, the matplotlib function that is used under the hood.    Examples The following examples are generated with random data from a normal distribution. 
>>> n = 10000
>>> df = pd.DataFrame({'x': np.random.randn(n),
...                    'y': np.random.randn(n)})
>>> ax = df.plot.hexbin(x='x', y='y', gridsize=20)
     The next example uses C and np.sum as reduce_C_function. Note that ‘observations’ values ranges from 1 to 5 but the result plot shows values up to more than 25. This is because of the reduce_C_function. 
>>> n = 500
>>> df = pd.DataFrame({
...     'coord_x': np.random.uniform(-3, 3, size=n),
...     'coord_y': np.random.uniform(30, 50, size=n),
...     'observations': np.random.randint(1,5, size=n)
...     })
>>> ax = df.plot.hexbin(x='coord_x',
...                     y='coord_y',
...                     C='observations',
...                     reduce_C_function=np.sum,
...                     gridsize=10,
...                     cmap="viridis")
pandas.DataFrame.plot.hist   DataFrame.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.DataFrame.plot.kde   DataFrame.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.DataFrame.plot.line   DataFrame.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.DataFrame.plot.pie   DataFrame.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.DataFrame.plot.scatter   DataFrame.plot.scatter(x, y, s=None, c=None, **kwargs)[source]
 
Create a scatter plot with varying marker point size and color. The coordinates of each point are defined by two dataframe columns and filled circles are used to represent each point. This kind of plot is useful to see complex correlations between two variables. Points could be for instance natural 2D coordinates like longitude and latitude in a map or, in general, any pair of metrics that can be plotted against each other.  Parameters 
 
x:int or str


The column name or column position to be used as horizontal coordinates for each point.  
y:int or str


The column name or column position to be used as vertical coordinates for each point.  
s:str, scalar or array-like, optional


The size of each point. Possible values are:  A string with the name of the column to be used for marker’s size. A single scalar so all points have the same size. 
A sequence of scalars, which will be used for each point’s size recursively. For instance, when passing [2,14] all points size will be either 2 or 14, alternatively.  Changed in version 1.1.0.     
c:str, int or array-like, optional


The color of each point. 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 point’s color recursively. For instance [‘green’,’yellow’] all points will be filled in green or yellow, alternatively. A column name or position whose values will be used to color the marker points according to a colormap.   **kwargs

Keyword arguments to pass on to DataFrame.plot().    Returns 
 
matplotlib.axes.Axes or numpy.ndarray of them
    See also  matplotlib.pyplot.scatter

Scatter plot using multiple input data formats.    Examples Let’s see how to draw a scatter plot using coordinates from the values in a DataFrame’s columns. 
>>> df = pd.DataFrame([[5.1, 3.5, 0], [4.9, 3.0, 0], [7.0, 3.2, 1],
...                    [6.4, 3.2, 1], [5.9, 3.0, 2]],
...                   columns=['length', 'width', 'species'])
>>> ax1 = df.plot.scatter(x='length',
...                       y='width',
...                       c='DarkBlue')
     And now with the color determined by a column as well. 
>>> ax2 = df.plot.scatter(x='length',
...                       y='width',
...                       c='species',
...                       colormap='viridis')
pandas.DataFrame.pop   DataFrame.pop(item)[source]
 
Return item and drop from frame. Raise KeyError if not found.  Parameters 
 
item:label


Label of column to be popped.    Returns 
 Series
   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'))
>>> df
     name   class  max_speed
0  falcon    bird      389.0
1  parrot    bird       24.0
2    lion  mammal       80.5
3  monkey  mammal        NaN
  
>>> df.pop('class')
0      bird
1      bird
2    mammal
3    mammal
Name: class, dtype: object
  
>>> df
     name  max_speed
0  falcon      389.0
1  parrot       24.0
2    lion       80.5
3  monkey        NaN
pandas.DataFrame.prod   DataFrame.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), 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.  
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 
 Series or DataFrame (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
pandas.DataFrame.product   DataFrame.product(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), 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.  
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 
 Series or DataFrame (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
pandas.DataFrame.quantile   DataFrame.quantile(q=0.5, axis=0, numeric_only=True, interpolation='linear')[source]
 
Return values at the given quantile over requested axis.  Parameters 
 
q:float or array-like, default 0.5 (50% quantile)


Value between 0 <= q <= 1, the quantile(s) to compute.  
axis:{0, 1, ‘index’, ‘columns’}, default 0


Equals 0 or ‘index’ for row-wise, 1 or ‘columns’ for column-wise.  
numeric_only:bool, default True


If False, the quantile of datetime and timedelta data will be computed as well.  
interpolation:{‘linear’, ‘lower’, ‘higher’, ‘midpoint’, ‘nearest’}


This optional parameter specifies the interpolation method to use, when the desired quantile lies between two data points i and j:  linear: i + (j - i) * fraction, where fraction is the fractional part of the index surrounded by i and j. lower: i. higher: j. nearest: i or j whichever is nearest. midpoint: (i + j) / 2.     Returns 
 Series or DataFrame

 If q is an array, a DataFrame will be returned where the

index is q, the columns are the columns of self, and the values are the quantiles.  If q is a float, a Series will be returned where the

index is the columns of self and the values are the quantiles.        See also  core.window.Rolling.quantile

Rolling quantile.  numpy.percentile

Numpy function to compute the percentile.    Examples 
>>> df = pd.DataFrame(np.array([[1, 1], [2, 10], [3, 100], [4, 100]]),
...                   columns=['a', 'b'])
>>> df.quantile(.1)
a    1.3
b    3.7
Name: 0.1, dtype: float64
>>> df.quantile([.1, .5])
       a     b
0.1  1.3   3.7
0.5  2.5  55.0
  Specifying numeric_only=False will also compute the quantile of datetime and timedelta data. 
>>> df = pd.DataFrame({'A': [1, 2],
...                    'B': [pd.Timestamp('2010'),
...                          pd.Timestamp('2011')],
...                    'C': [pd.Timedelta('1 days'),
...                          pd.Timedelta('2 days')]})
>>> df.quantile(0.5, numeric_only=False)
A                    1.5
B    2010-07-02 12:00:00
C        1 days 12:00:00
Name: 0.5, dtype: object