neulab/docprompting-conala huggingface dataset:
pandas.Series.cumsum   Series.cumsum(axis=None, skipna=True, *args, **kwargs)[source]
 
Return cumulative sum over a DataFrame or Series axis. Returns a DataFrame or Series of the same size containing the cumulative sum.  Parameters 
 
axis:{0 or ‘index’, 1 or ‘columns’}, default 0


The index or the name of the axis. 0 is equivalent to None or ‘index’.  
skipna:bool, default True


Exclude NA/null values. If an entire row/column is NA, the result will be NA.  *args, **kwargs

Additional keywords have no effect but might be accepted for compatibility with NumPy.    Returns 
 scalar or Series

Return cumulative sum of scalar or Series.      See also  core.window.Expanding.sum

Similar functionality but ignores NaN values.  Series.sum

Return the sum over Series axis.  Series.cummax

Return cumulative maximum over Series axis.  Series.cummin

Return cumulative minimum over Series axis.  Series.cumsum

Return cumulative sum over Series axis.  Series.cumprod

Return cumulative product over Series axis.    Examples Series 
>>> s = pd.Series([2, np.nan, 5, -1, 0])
>>> s
0    2.0
1    NaN
2    5.0
3   -1.0
4    0.0
dtype: float64
  By default, NA values are ignored. 
>>> s.cumsum()
0    2.0
1    NaN
2    7.0
3    6.0
4    6.0
dtype: float64
  To include NA values in the operation, use skipna=False 
>>> s.cumsum(skipna=False)
0    2.0
1    NaN
2    NaN
3    NaN
4    NaN
dtype: float64
  DataFrame 
>>> df = pd.DataFrame([[2.0, 1.0],
...                    [3.0, np.nan],
...                    [1.0, 0.0]],
...                    columns=list('AB'))
>>> df
     A    B
0  2.0  1.0
1  3.0  NaN
2  1.0  0.0
  By default, iterates over rows and finds the sum in each column. This is equivalent to axis=None or axis='index'. 
>>> df.cumsum()
     A    B
0  2.0  1.0
1  5.0  NaN
2  6.0  1.0
  To iterate over columns and find the sum in each row, use axis=1 
>>> df.cumsum(axis=1)
     A    B
0  2.0  3.0
1  3.0  NaN
2  1.0  1.0
pandas.Series.diff   Series.diff(periods=1)[source]
 
First discrete difference of element. Calculates the difference of a Series element compared with another element in the Series (default is element in previous row).  Parameters 
 
periods:int, default 1


Periods to shift for calculating difference, accepts negative values.    Returns 
 Series

First differences of the Series.      See also  Series.pct_change

Percent change over given number of periods.  Series.shift

Shift index by desired number of periods with an optional time freq.  DataFrame.diff

First discrete difference of object.    Notes For boolean dtypes, this uses operator.xor() rather than operator.sub(). The result is calculated according to current dtype in Series, however dtype of the result is always float64. Examples Difference with previous row 
>>> s = pd.Series([1, 1, 2, 3, 5, 8])
>>> s.diff()
0    NaN
1    0.0
2    1.0
3    1.0
4    2.0
5    3.0
dtype: float64
  Difference with 3rd previous row 
>>> s.diff(periods=3)
0    NaN
1    NaN
2    NaN
3    2.0
4    4.0
5    6.0
dtype: float64
  Difference with following row 
>>> s.diff(periods=-1)
0    0.0
1   -1.0
2   -1.0
3   -2.0
4   -3.0
5    NaN
dtype: float64
  Overflow in input dtype 
>>> s = pd.Series([1, 0], dtype=np.uint8)
>>> s.diff()
0      NaN
1    255.0
dtype: float64
pandas.Series.div   Series.div(other, level=None, fill_value=None, axis=0)[source]
 
Return Floating division of series and other, element-wise (binary operator truediv). 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.rtruediv

Reverse of the Floating division 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.divide(b, fill_value=0)
a    1.0
b    inf
c    inf
d    0.0
e    NaN
dtype: float64
pandas.Series.divide   Series.divide(other, level=None, fill_value=None, axis=0)[source]
 
Return Floating division of series and other, element-wise (binary operator truediv). 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.rtruediv

Reverse of the Floating division 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.divide(b, fill_value=0)
a    1.0
b    inf
c    inf
d    0.0
e    NaN
dtype: float64
pandas.Series.divmod   Series.divmod(other, level=None, fill_value=None, axis=0)[source]
 
Return Integer division and modulo of series and other, element-wise (binary operator divmod). Equivalent to divmod(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 
 2-Tuple of Series

The result of the operation.      See also  Series.rdivmod

Reverse of the Integer division and modulo 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.divmod(b, fill_value=0)
(a    1.0
 b    NaN
 c    NaN
 d    0.0
 e    NaN
 dtype: float64,
 a    0.0
 b    NaN
 c    NaN
 d    0.0
 e    NaN
 dtype: float64)
pandas.Series.dot   Series.dot(other)[source]
 
Compute the dot product between the Series and the columns of other. This method computes the dot product between the Series and another one, or the Series and each columns of a DataFrame, or the Series and each columns of an array. It can also be called using self @ other in Python >= 3.5.  Parameters 
 
other:Series, DataFrame or array-like


The other object to compute the dot product with its columns.    Returns 
 scalar, Series or numpy.ndarray

Return the dot product of the Series and other if other is a Series, the Series of the dot product of Series and each rows of other if other is a DataFrame or a numpy.ndarray between the Series and each columns of the numpy array.      See also  DataFrame.dot

Compute the matrix product with the DataFrame.  Series.mul

Multiplication of series and other, element-wise.    Notes The Series and other has to share the same index if other is a Series or a DataFrame. Examples 
>>> s = pd.Series([0, 1, 2, 3])
>>> other = pd.Series([-1, 2, -3, 4])
>>> s.dot(other)
8
>>> s @ other
8
>>> df = pd.DataFrame([[0, 1], [-2, 3], [4, -5], [6, 7]])
>>> s.dot(df)
0    24
1    14
dtype: int64
>>> arr = np.array([[0, 1], [-2, 3], [4, -5], [6, 7]])
>>> s.dot(arr)
array([24, 14])
pandas.Series.drop   Series.drop(labels=None, axis=0, index=None, columns=None, level=None, inplace=False, errors='raise')[source]
 
Return Series with specified index labels removed. Remove elements of a Series based on specifying the index labels. When using a multi-index, labels on different levels can be removed by specifying the level.  Parameters 
 
labels:single label or list-like


Index labels to drop.  
axis:0, default 0


Redundant for application on Series.  
index:single label or list-like


Redundant for application on Series, but ‘index’ can be used instead of ‘labels’.  
columns:single label or list-like


No change is made to the Series; use ‘index’ or ‘labels’ instead.  
level:int or level name, optional


For MultiIndex, level for which the labels will be removed.  
inplace:bool, default False


If True, do operation inplace and return None.  
errors:{‘ignore’, ‘raise’}, default ‘raise’


If ‘ignore’, suppress error and only existing labels are dropped.    Returns 
 Series or None

Series with specified index labels removed or None if inplace=True.    Raises 
 KeyError

If none of the labels are found in the index.      See also  Series.reindex

Return only specified index labels of Series.  Series.dropna

Return series without null values.  Series.drop_duplicates

Return Series with duplicate values removed.  DataFrame.drop

Drop specified labels from rows or columns.    Examples 
>>> s = pd.Series(data=np.arange(3), index=['A', 'B', 'C'])
>>> s
A  0
B  1
C  2
dtype: int64
  Drop labels B en C 
>>> s.drop(labels=['B', 'C'])
A  0
dtype: int64
  Drop 2nd level label in MultiIndex Series 
>>> midx = pd.MultiIndex(levels=[['lama', 'cow', 'falcon'],
...                              ['speed', 'weight', 'length']],
...                      codes=[[0, 0, 0, 1, 1, 1, 2, 2, 2],
...                             [0, 1, 2, 0, 1, 2, 0, 1, 2]])
>>> s = pd.Series([45, 200, 1.2, 30, 250, 1.5, 320, 1, 0.3],
...               index=midx)
>>> s
lama    speed      45.0
        weight    200.0
        length      1.2
cow     speed      30.0
        weight    250.0
        length      1.5
falcon  speed     320.0
        weight      1.0
        length      0.3
dtype: float64
  
>>> s.drop(labels='weight', level=1)
lama    speed      45.0
        length      1.2
cow     speed      30.0
        length      1.5
falcon  speed     320.0
        length      0.3
dtype: float64
pandas.Series.drop_duplicates   Series.drop_duplicates(keep='first', inplace=False)[source]
 
Return Series with duplicate values removed.  Parameters 
 
keep:{‘first’, ‘last’, False}, default ‘first’


Method to handle dropping duplicates:  ‘first’ : Drop duplicates except for the first occurrence. ‘last’ : Drop duplicates except for the last occurrence. False : Drop all duplicates.   
inplace:bool, default False


If True, performs operation inplace and returns None.    Returns 
 Series or None

Series with duplicates dropped or None if inplace=True.      See also  Index.drop_duplicates

Equivalent method on Index.  DataFrame.drop_duplicates

Equivalent method on DataFrame.  Series.duplicated

Related method on Series, indicating duplicate Series values.    Examples Generate a Series with duplicated entries. 
>>> s = pd.Series(['lama', 'cow', 'lama', 'beetle', 'lama', 'hippo'],
...               name='animal')
>>> s
0      lama
1       cow
2      lama
3    beetle
4      lama
5     hippo
Name: animal, dtype: object
  With the ‘keep’ parameter, the selection behaviour of duplicated values can be changed. The value ‘first’ keeps the first occurrence for each set of duplicated entries. The default value of keep is ‘first’. 
>>> s.drop_duplicates()
0      lama
1       cow
3    beetle
5     hippo
Name: animal, dtype: object
  The value ‘last’ for parameter ‘keep’ keeps the last occurrence for each set of duplicated entries. 
>>> s.drop_duplicates(keep='last')
1       cow
3    beetle
4      lama
5     hippo
Name: animal, dtype: object
  The value False for parameter ‘keep’ discards all sets of duplicated entries. Setting the value of ‘inplace’ to True performs the operation inplace and returns None. 
>>> s.drop_duplicates(keep=False, inplace=True)
>>> s
1       cow
3    beetle
5     hippo
Name: animal, dtype: object
pandas.Series.droplevel   Series.droplevel(level, axis=0)[source]
 
Return Series/DataFrame with requested index / column level(s) removed.  Parameters 
 
level:int, str, or list-like


If a string is given, must be the name of a level If list-like, elements must be names or positional indexes of levels.  
axis:{0 or ‘index’, 1 or ‘columns’}, default 0


Axis along which the level(s) is removed:  0 or ‘index’: remove level(s) in column. 1 or ‘columns’: remove level(s) in row.     Returns 
 Series/DataFrame

Series/DataFrame with requested index / column level(s) removed.     Examples 
>>> df = pd.DataFrame([
...     [1, 2, 3, 4],
...     [5, 6, 7, 8],
...     [9, 10, 11, 12]
... ]).set_index([0, 1]).rename_axis(['a', 'b'])
  
>>> df.columns = pd.MultiIndex.from_tuples([
...     ('c', 'e'), ('d', 'f')
... ], names=['level_1', 'level_2'])
  
>>> df
level_1   c   d
level_2   e   f
a b
1 2      3   4
5 6      7   8
9 10    11  12
  
>>> df.droplevel('a')
level_1   c   d
level_2   e   f
b
2        3   4
6        7   8
10      11  12
  
>>> df.droplevel('level_2', axis=1)
level_1   c   d
a b
1 2      3   4
5 6      7   8
9 10    11  12
pandas.Series.dropna   Series.dropna(axis=0, inplace=False, how=None)[source]
 
Return a new Series with missing values removed. See the User Guide for more on which values are considered missing, and how to work with missing data.  Parameters 
 
axis:{0 or ‘index’}, default 0


There is only one axis to drop values from.  
inplace:bool, default False


If True, do operation inplace and return None.  
how:str, optional


Not in use. Kept for compatibility.    Returns 
 Series or None

Series with NA entries dropped from it or None if inplace=True.      See also  Series.isna

Indicate missing values.  Series.notna

Indicate existing (non-missing) values.  Series.fillna

Replace missing values.  DataFrame.dropna

Drop rows or columns which contain NA values.  Index.dropna

Drop missing indices.    Examples 
>>> ser = pd.Series([1., 2., np.nan])
>>> ser
0    1.0
1    2.0
2    NaN
dtype: float64
  Drop NA values from a Series. 
>>> ser.dropna()
0    1.0
1    2.0
dtype: float64
  Keep the Series with valid entries in the same variable. 
>>> ser.dropna(inplace=True)
>>> ser
0    1.0
1    2.0
dtype: float64
  Empty strings are not considered NA values. None is considered an NA value. 
>>> ser = pd.Series([np.NaN, 2, pd.NaT, '', None, 'I stay'])
>>> ser
0       NaN
1         2
2       NaT
3
4      None
5    I stay
dtype: object
>>> ser.dropna()
1         2
3
5    I stay
dtype: object
pandas.Series.dt   Series.dt()[source]
 
Accessor object for datetimelike properties of the Series values. Examples 
>>> seconds_series = pd.Series(pd.date_range("2000-01-01", periods=3, freq="s"))
>>> seconds_series
0   2000-01-01 00:00:00
1   2000-01-01 00:00:01
2   2000-01-01 00:00:02
dtype: datetime64[ns]
>>> seconds_series.dt.second
0    0
1    1
2    2
dtype: int64
  
>>> hours_series = pd.Series(pd.date_range("2000-01-01", periods=3, freq="h"))
>>> hours_series
0   2000-01-01 00:00:00
1   2000-01-01 01:00:00
2   2000-01-01 02:00:00
dtype: datetime64[ns]
>>> hours_series.dt.hour
0    0
1    1
2    2
dtype: int64
  
>>> quarters_series = pd.Series(pd.date_range("2000-01-01", periods=3, freq="q"))
>>> quarters_series
0   2000-03-31
1   2000-06-30
2   2000-09-30
dtype: datetime64[ns]
>>> quarters_series.dt.quarter
0    1
1    2
2    3
dtype: int64
  Returns a Series indexed like the original Series. Raises TypeError if the Series does not contain datetimelike values.
pandas.Series.dt.ceil   Series.dt.ceil(*args, **kwargs)[source]
 
Perform ceil operation on the data to the specified freq.  Parameters 
 
freq:str or Offset


The frequency level to ceil the index to. Must be a fixed frequency like ‘S’ (second) not ‘ME’ (month end). See frequency aliases for a list of possible freq values.  
ambiguous:‘infer’, bool-ndarray, ‘NaT’, default ‘raise’


Only relevant for DatetimeIndex:  ‘infer’ will attempt to infer fall dst-transition hours based on order bool-ndarray where True signifies a DST time, False designates a non-DST time (note that this flag is only applicable for ambiguous times) ‘NaT’ will return NaT where there are ambiguous times ‘raise’ will raise an AmbiguousTimeError if there are ambiguous times.   
nonexistent:‘shift_forward’, ‘shift_backward’, ‘NaT’, timedelta, default ‘raise’


A nonexistent time does not exist in a particular timezone where clocks moved forward due to DST.  ‘shift_forward’ will shift the nonexistent time forward to the closest existing time ‘shift_backward’ will shift the nonexistent time backward to the closest existing time ‘NaT’ will return NaT where there are nonexistent times timedelta objects will shift nonexistent times by the timedelta ‘raise’ will raise an NonExistentTimeError if there are nonexistent times.     Returns 
 DatetimeIndex, TimedeltaIndex, or Series

Index of the same type for a DatetimeIndex or TimedeltaIndex, or a Series with the same index for a Series.    Raises 
 ValueError if the freq cannot be converted.
   Notes If the timestamps have a timezone, ceiling will take place relative to the local (“wall”) time and re-localized to the same timezone. When ceiling near daylight savings time, use nonexistent and ambiguous to control the re-localization behavior. Examples DatetimeIndex 
>>> rng = pd.date_range('1/1/2018 11:59:00', periods=3, freq='min')
>>> rng
DatetimeIndex(['2018-01-01 11:59:00', '2018-01-01 12:00:00',
               '2018-01-01 12:01:00'],
              dtype='datetime64[ns]', freq='T')
>>> rng.ceil('H')
DatetimeIndex(['2018-01-01 12:00:00', '2018-01-01 12:00:00',
               '2018-01-01 13:00:00'],
              dtype='datetime64[ns]', freq=None)
  Series 
>>> pd.Series(rng).dt.ceil("H")
0   2018-01-01 12:00:00
1   2018-01-01 12:00:00
2   2018-01-01 13:00:00
dtype: datetime64[ns]
  When rounding near a daylight savings time transition, use ambiguous or nonexistent to control how the timestamp should be re-localized. 
>>> rng_tz = pd.DatetimeIndex(["2021-10-31 01:30:00"], tz="Europe/Amsterdam")
  
>>> rng_tz.ceil("H", ambiguous=False)
DatetimeIndex(['2021-10-31 02:00:00+01:00'],
              dtype='datetime64[ns, Europe/Amsterdam]', freq=None)
  
>>> rng_tz.ceil("H", ambiguous=True)
DatetimeIndex(['2021-10-31 02:00:00+02:00'],
              dtype='datetime64[ns, Europe/Amsterdam]', freq=None)
pandas.Series.dt.components   Series.dt.components
 
Return a Dataframe of the components of the Timedeltas.  Returns 
 DataFrame
   Examples 
>>> s = pd.Series(pd.to_timedelta(np.arange(5), unit='s'))
>>> s
0   0 days 00:00:00
1   0 days 00:00:01
2   0 days 00:00:02
3   0 days 00:00:03
4   0 days 00:00:04
dtype: timedelta64[ns]
>>> s.dt.components
   days  hours  minutes  seconds  milliseconds  microseconds  nanoseconds
0     0      0        0        0             0             0            0
1     0      0        0        1             0             0            0
2     0      0        0        2             0             0            0
3     0      0        0        3             0             0            0
4     0      0        0        4             0             0            0
pandas.Series.dt.date   Series.dt.date
 
Returns numpy array of python datetime.date objects. Namely, the date part of Timestamps without time and timezone information.
pandas.Series.dt.day   Series.dt.day
 
The day of the datetime. Examples 
>>> datetime_series = pd.Series(
...     pd.date_range("2000-01-01", periods=3, freq="D")
... )
>>> datetime_series
0   2000-01-01
1   2000-01-02
2   2000-01-03
dtype: datetime64[ns]
>>> datetime_series.dt.day
0    1
1    2
2    3
dtype: int64
pandas.Series.dt.day_name   Series.dt.day_name(*args, **kwargs)[source]
 
Return the day names of the DateTimeIndex with specified locale.  Parameters 
 
locale:str, optional


Locale determining the language in which to return the day name. Default is English locale.    Returns 
 Index

Index of day names.     Examples 
>>> idx = pd.date_range(start='2018-01-01', freq='D', periods=3)
>>> idx
DatetimeIndex(['2018-01-01', '2018-01-02', '2018-01-03'],
              dtype='datetime64[ns]', freq='D')
>>> idx.day_name()
Index(['Monday', 'Tuesday', 'Wednesday'], dtype='object')
pandas.Series.dt.day_of_week   Series.dt.day_of_week
 
The day of the week with Monday=0, Sunday=6. Return the day of the week. It is assumed the week starts on Monday, which is denoted by 0 and ends on Sunday which is denoted by 6. This method is available on both Series with datetime values (using the dt accessor) or DatetimeIndex.  Returns 
 Series or Index

Containing integers indicating the day number.      See also  Series.dt.dayofweek

Alias.  Series.dt.weekday

Alias.  Series.dt.day_name

Returns the name of the day of the week.    Examples 
>>> s = pd.date_range('2016-12-31', '2017-01-08', freq='D').to_series()
>>> s.dt.dayofweek
2016-12-31    5
2017-01-01    6
2017-01-02    0
2017-01-03    1
2017-01-04    2
2017-01-05    3
2017-01-06    4
2017-01-07    5
2017-01-08    6
Freq: D, dtype: int64
pandas.Series.dt.day_of_year   Series.dt.day_of_year
 
The ordinal day of the year.
pandas.Series.dt.dayofweek   Series.dt.dayofweek
 
The day of the week with Monday=0, Sunday=6. Return the day of the week. It is assumed the week starts on Monday, which is denoted by 0 and ends on Sunday which is denoted by 6. This method is available on both Series with datetime values (using the dt accessor) or DatetimeIndex.  Returns 
 Series or Index

Containing integers indicating the day number.      See also  Series.dt.dayofweek

Alias.  Series.dt.weekday

Alias.  Series.dt.day_name

Returns the name of the day of the week.    Examples 
>>> s = pd.date_range('2016-12-31', '2017-01-08', freq='D').to_series()
>>> s.dt.dayofweek
2016-12-31    5
2017-01-01    6
2017-01-02    0
2017-01-03    1
2017-01-04    2
2017-01-05    3
2017-01-06    4
2017-01-07    5
2017-01-08    6
Freq: D, dtype: int64
pandas.Series.dt.dayofyear   Series.dt.dayofyear
 
The ordinal day of the year.
pandas.Series.dt.days   Series.dt.days
 
Number of days for each element.
pandas.Series.dt.days_in_month   Series.dt.days_in_month
 
The number of days in the month.
pandas.Series.dt.daysinmonth   Series.dt.daysinmonth
 
The number of days in the month.