neulab/docprompting-conala huggingface dataset:
pandas.DataFrame.all   DataFrame.all(axis=0, bool_only=None, skipna=True, level=None, **kwargs)[source]
 
Return whether all elements are True, potentially over an axis. Returns True unless there at least one element within a series or along a Dataframe axis that is False or equivalent (e.g. zero or empty).  Parameters 
 
axis:{0 or ‘index’, 1 or ‘columns’, None}, default 0


Indicate which axis or axes should be reduced.  0 / ‘index’ : reduce the index, return a Series whose index is the original column labels. 1 / ‘columns’ : reduce the columns, return a Series whose index is the original index. None : reduce all axes, return a scalar.   
bool_only:bool, default None


Include only boolean columns. If None, will attempt to use everything, then use only boolean data. Not implemented for Series.  
skipna:bool, default True


Exclude NA/null values. If the entire row/column is NA and skipna is True, then the result will be True, as for an empty row/column. If skipna is False, then NA are treated as True, because these are not equal to zero.  
level:int or level name, default None


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


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

If level is specified, then, DataFrame is returned; otherwise, Series is returned.      See also  Series.all

Return True if all elements are True.  DataFrame.any

Return True if one (or more) elements are True.    Examples Series 
>>> pd.Series([True, True]).all()
True
>>> pd.Series([True, False]).all()
False
>>> pd.Series([], dtype="float64").all()
True
>>> pd.Series([np.nan]).all()
True
>>> pd.Series([np.nan]).all(skipna=False)
True
  DataFrames Create a dataframe from a dictionary. 
>>> df = pd.DataFrame({'col1': [True, True], 'col2': [True, False]})
>>> df
   col1   col2
0  True   True
1  True  False
  Default behaviour checks if column-wise values all return True. 
>>> df.all()
col1     True
col2    False
dtype: bool
  Specify axis='columns' to check if row-wise values all return True. 
>>> df.all(axis='columns')
0     True
1    False
dtype: bool
  Or axis=None for whether every value is True. 
>>> df.all(axis=None)
False
pandas.DataFrame.any   DataFrame.any(axis=0, bool_only=None, skipna=True, level=None, **kwargs)[source]
 
Return whether any element is True, potentially over an axis. Returns False unless there is at least one element within a series or along a Dataframe axis that is True or equivalent (e.g. non-zero or non-empty).  Parameters 
 
axis:{0 or ‘index’, 1 or ‘columns’, None}, default 0


Indicate which axis or axes should be reduced.  0 / ‘index’ : reduce the index, return a Series whose index is the original column labels. 1 / ‘columns’ : reduce the columns, return a Series whose index is the original index. None : reduce all axes, return a scalar.   
bool_only:bool, default None


Include only boolean columns. If None, will attempt to use everything, then use only boolean data. Not implemented for Series.  
skipna:bool, default True


Exclude NA/null values. If the entire row/column is NA and skipna is True, then the result will be False, as for an empty row/column. If skipna is False, then NA are treated as True, because these are not equal to zero.  
level:int or level name, default None


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


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

If level is specified, then, DataFrame is returned; otherwise, Series is returned.      See also  numpy.any

Numpy version of this method.  Series.any

Return whether any element is True.  Series.all

Return whether all elements are True.  DataFrame.any

Return whether any element is True over requested axis.  DataFrame.all

Return whether all elements are True over requested axis.    Examples Series For Series input, the output is a scalar indicating whether any element is True. 
>>> pd.Series([False, False]).any()
False
>>> pd.Series([True, False]).any()
True
>>> pd.Series([], dtype="float64").any()
False
>>> pd.Series([np.nan]).any()
False
>>> pd.Series([np.nan]).any(skipna=False)
True
  DataFrame Whether each column contains at least one True element (the default). 
>>> df = pd.DataFrame({"A": [1, 2], "B": [0, 2], "C": [0, 0]})
>>> df
   A  B  C
0  1  0  0
1  2  2  0
  
>>> df.any()
A     True
B     True
C    False
dtype: bool
  Aggregating over the columns. 
>>> df = pd.DataFrame({"A": [True, False], "B": [1, 2]})
>>> df
       A  B
0   True  1
1  False  2
  
>>> df.any(axis='columns')
0    True
1    True
dtype: bool
  
>>> df = pd.DataFrame({"A": [True, False], "B": [1, 0]})
>>> df
       A  B
0   True  1
1  False  0
  
>>> df.any(axis='columns')
0    True
1    False
dtype: bool
  Aggregating over the entire DataFrame with axis=None. 
>>> df.any(axis=None)
True
  any for an empty DataFrame is an empty Series. 
>>> pd.DataFrame([]).any()
Series([], dtype: bool)
pandas.DataFrame.append   DataFrame.append(other, ignore_index=False, verify_integrity=False, sort=False)[source]
 
Append rows of other to the end of caller, returning a new object. Columns in other that are not in the caller are added as new columns.  Parameters 
 
other:DataFrame or Series/dict-like object, or list of these


The data to append.  
ignore_index:bool, default False


If True, the resulting axis will be labeled 0, 1, …, n - 1.  
verify_integrity:bool, default False


If True, raise ValueError on creating index with duplicates.  
sort:bool, default False


Sort columns if the columns of self and other are not aligned.  Changed in version 1.0.0: Changed to not sort by default.     Returns 
 DataFrame

A new DataFrame consisting of the rows of caller and the rows of other.      See also  concat

General function to concatenate DataFrame or Series objects.    Notes If a list of dict/series is passed and the keys are all contained in the DataFrame’s index, the order of the columns in the resulting DataFrame will be unchanged. Iteratively appending rows to a DataFrame can be more computationally intensive than a single concatenate. A better solution is to append those rows to a list and then concatenate the list with the original DataFrame all at once. Examples 
>>> df = pd.DataFrame([[1, 2], [3, 4]], columns=list('AB'), index=['x', 'y'])
>>> df
   A  B
x  1  2
y  3  4
>>> df2 = pd.DataFrame([[5, 6], [7, 8]], columns=list('AB'), index=['x', 'y'])
>>> df.append(df2)
   A  B
x  1  2
y  3  4
x  5  6
y  7  8
  With ignore_index set to True: 
>>> df.append(df2, ignore_index=True)
   A  B
0  1  2
1  3  4
2  5  6
3  7  8
  The following, while not recommended methods for generating DataFrames, show two ways to generate a DataFrame from multiple data sources. Less efficient: 
>>> df = pd.DataFrame(columns=['A'])
>>> for i in range(5):
...     df = df.append({'A': i}, ignore_index=True)
>>> df
   A
0  0
1  1
2  2
3  3
4  4
  More efficient: 
>>> pd.concat([pd.DataFrame([i], columns=['A']) for i in range(5)],
...           ignore_index=True)
   A
0  0
1  1
2  2
3  3
4  4
pandas.DataFrame.applymap   DataFrame.applymap(func, na_action=None, **kwargs)[source]
 
Apply a function to a Dataframe elementwise. This method applies a function that accepts and returns a scalar to every element of a DataFrame.  Parameters 
 
func:callable


Python function, returns a single value from a single value.  
na_action:{None, ‘ignore’}, default None


If ‘ignore’, propagate NaN values, without passing them to func.  New in version 1.2.   **kwargs

Additional keyword arguments to pass as keywords arguments to func.  New in version 1.3.0.     Returns 
 DataFrame

Transformed DataFrame.      See also  DataFrame.apply

Apply a function along input axis of DataFrame.    Examples 
>>> df = pd.DataFrame([[1, 2.12], [3.356, 4.567]])
>>> df
       0      1
0  1.000  2.120
1  3.356  4.567
  
>>> df.applymap(lambda x: len(str(x)))
   0  1
0  3  4
1  5  5
  Like Series.map, NA values can be ignored: 
>>> df_copy = df.copy()
>>> df_copy.iloc[0, 0] = pd.NA
>>> df_copy.applymap(lambda x: len(str(x)), na_action='ignore')
      0  1
0  <NA>  4
1     5  5
  Note that a vectorized version of func often exists, which will be much faster. You could square each number elementwise. 
>>> df.applymap(lambda x: x**2)
           0          1
0   1.000000   4.494400
1  11.262736  20.857489
  But it’s better to avoid applymap in that case. 
>>> df ** 2
           0          1
0   1.000000   4.494400
1  11.262736  20.857489
pandas.DataFrame.asfreq   DataFrame.asfreq(freq, method=None, how=None, normalize=False, fill_value=None)[source]
 
Convert time series to specified frequency. Returns the original data conformed to a new index with the specified frequency. If the index of this DataFrame is a PeriodIndex, the new index is the result of transforming the original index with PeriodIndex.asfreq (so the original index will map one-to-one to the new index). Otherwise, the new index will be equivalent to pd.date_range(start, end,
freq=freq) where start and end are, respectively, the first and last entries in the original index (see pandas.date_range()). The values corresponding to any timesteps in the new index which were not present in the original index will be null (NaN), unless a method for filling such unknowns is provided (see the method parameter below). The resample() method is more appropriate if an operation on each group of timesteps (such as an aggregate) is necessary to represent the data at the new frequency.  Parameters 
 
freq:DateOffset or str


Frequency DateOffset or string.  
method:{‘backfill’/’bfill’, ‘pad’/’ffill’}, default None


Method to use for filling holes in reindexed Series (note this does not fill NaNs that already were present):  ‘pad’ / ‘ffill’: propagate last valid observation forward to next valid ‘backfill’ / ‘bfill’: use NEXT valid observation to fill.   
how:{‘start’, ‘end’}, default end


For PeriodIndex only (see PeriodIndex.asfreq).  
normalize:bool, default False


Whether to reset output index to midnight.  
fill_value:scalar, optional


Value to use for missing values, applied during upsampling (note this does not fill NaNs that already were present).    Returns 
 DataFrame

DataFrame object reindexed to the specified frequency.      See also  reindex

Conform DataFrame to new index with optional filling logic.    Notes To learn more about the frequency strings, please see this link. Examples Start by creating a series with 4 one minute timestamps. 
>>> index = pd.date_range('1/1/2000', periods=4, freq='T')
>>> series = pd.Series([0.0, None, 2.0, 3.0], index=index)
>>> df = pd.DataFrame({'s': series})
>>> df
                       s
2000-01-01 00:00:00    0.0
2000-01-01 00:01:00    NaN
2000-01-01 00:02:00    2.0
2000-01-01 00:03:00    3.0
  Upsample the series into 30 second bins. 
>>> df.asfreq(freq='30S')
                       s
2000-01-01 00:00:00    0.0
2000-01-01 00:00:30    NaN
2000-01-01 00:01:00    NaN
2000-01-01 00:01:30    NaN
2000-01-01 00:02:00    2.0
2000-01-01 00:02:30    NaN
2000-01-01 00:03:00    3.0
  Upsample again, providing a fill value. 
>>> df.asfreq(freq='30S', fill_value=9.0)
                       s
2000-01-01 00:00:00    0.0
2000-01-01 00:00:30    9.0
2000-01-01 00:01:00    NaN
2000-01-01 00:01:30    9.0
2000-01-01 00:02:00    2.0
2000-01-01 00:02:30    9.0
2000-01-01 00:03:00    3.0
  Upsample again, providing a method. 
>>> df.asfreq(freq='30S', method='bfill')
                       s
2000-01-01 00:00:00    0.0
2000-01-01 00:00:30    NaN
2000-01-01 00:01:00    NaN
2000-01-01 00:01:30    2.0
2000-01-01 00:02:00    2.0
2000-01-01 00:02:30    3.0
2000-01-01 00:03:00    3.0
pandas.DataFrame.asof   DataFrame.asof(where, subset=None)[source]
 
Return the last row(s) without any NaNs before where. The last row (for each element in where, if list) without any NaN is taken. In case of a DataFrame, the last row without NaN considering only the subset of columns (if not None) If there is no good value, NaN is returned for a Series or a Series of NaN values for a DataFrame  Parameters 
 
where:date or array-like of dates


Date(s) before which the last row(s) are returned.  
subset:str or array-like of str, default None


For DataFrame, if not None, only use these columns to check for NaNs.    Returns 
 scalar, Series, or DataFrame

The return can be:  scalar : when self is a Series and where is a scalar Series: when self is a Series and where is an array-like, or when self is a DataFrame and where is a scalar DataFrame : when self is a DataFrame and where is an array-like  Return scalar, Series, or DataFrame.      See also  merge_asof

Perform an asof merge. Similar to left join.    Notes Dates are assumed to be sorted. Raises if this is not the case. Examples A Series and a scalar where. 
>>> s = pd.Series([1, 2, np.nan, 4], index=[10, 20, 30, 40])
>>> s
10    1.0
20    2.0
30    NaN
40    4.0
dtype: float64
  
>>> s.asof(20)
2.0
  For a sequence where, a Series is returned. The first value is NaN, because the first element of where is before the first index value. 
>>> s.asof([5, 20])
5     NaN
20    2.0
dtype: float64
  Missing values are not considered. The following is 2.0, not NaN, even though NaN is at the index location for 30. 
>>> s.asof(30)
2.0
  Take all columns into consideration 
>>> df = pd.DataFrame({'a': [10, 20, 30, 40, 50],
...                    'b': [None, None, None, None, 500]},
...                   index=pd.DatetimeIndex(['2018-02-27 09:01:00',
...                                           '2018-02-27 09:02:00',
...                                           '2018-02-27 09:03:00',
...                                           '2018-02-27 09:04:00',
...                                           '2018-02-27 09:05:00']))
>>> df.asof(pd.DatetimeIndex(['2018-02-27 09:03:30',
...                           '2018-02-27 09:04:30']))
                      a   b
2018-02-27 09:03:30 NaN NaN
2018-02-27 09:04:30 NaN NaN
  Take a single column into consideration 
>>> df.asof(pd.DatetimeIndex(['2018-02-27 09:03:30',
...                           '2018-02-27 09:04:30']),
...         subset=['a'])
                         a   b
2018-02-27 09:03:30   30.0 NaN
2018-02-27 09:04:30   40.0 NaN
pandas.DataFrame.assign   DataFrame.assign(**kwargs)[source]
 
Assign new columns to a DataFrame. Returns a new object with all original columns in addition to new ones. Existing columns that are re-assigned will be overwritten.  Parameters 
 
**kwargs:dict of {str: callable or Series}


The column names are keywords. If the values are callable, they are computed on the DataFrame and assigned to the new columns. The callable must not change input DataFrame (though pandas doesn’t check it). If the values are not callable, (e.g. a Series, scalar, or array), they are simply assigned.    Returns 
 DataFrame

A new DataFrame with the new columns in addition to all the existing columns.     Notes Assigning multiple columns within the same assign is possible. Later items in ‘**kwargs’ may refer to newly created or modified columns in ‘df’; items are computed and assigned into ‘df’ in order. Examples 
>>> df = pd.DataFrame({'temp_c': [17.0, 25.0]},
...                   index=['Portland', 'Berkeley'])
>>> df
          temp_c
Portland    17.0
Berkeley    25.0
  Where the value is a callable, evaluated on df: 
>>> df.assign(temp_f=lambda x: x.temp_c * 9 / 5 + 32)
          temp_c  temp_f
Portland    17.0    62.6
Berkeley    25.0    77.0
  Alternatively, the same behavior can be achieved by directly referencing an existing Series or sequence: 
>>> df.assign(temp_f=df['temp_c'] * 9 / 5 + 32)
          temp_c  temp_f
Portland    17.0    62.6
Berkeley    25.0    77.0
  You can create multiple columns within the same assign where one of the columns depends on another one defined within the same assign: 
>>> df.assign(temp_f=lambda x: x['temp_c'] * 9 / 5 + 32,
...           temp_k=lambda x: (x['temp_f'] +  459.67) * 5 / 9)
          temp_c  temp_f  temp_k
Portland    17.0    62.6  290.15
Berkeley    25.0    77.0  298.15
pandas.DataFrame.astype   DataFrame.astype(dtype, copy=True, errors='raise')[source]
 
Cast a pandas object to a specified dtype dtype.  Parameters 
 
dtype:data type, or dict of column name -> data type


Use a numpy.dtype or Python type to cast entire pandas object to the same type. Alternatively, use {col: dtype, …}, where col is a column label and dtype is a numpy.dtype or Python type to cast one or more of the DataFrame’s columns to column-specific types.  
copy:bool, default True


Return a copy when copy=True (be very careful setting copy=False as changes to values then may propagate to other pandas objects).  
errors:{‘raise’, ‘ignore’}, default ‘raise’


Control raising of exceptions on invalid data for provided dtype.  raise : allow exceptions to be raised ignore : suppress exceptions. On error return original object.     Returns 
 
casted:same type as caller

    See also  to_datetime

Convert argument to datetime.  to_timedelta

Convert argument to timedelta.  to_numeric

Convert argument to a numeric type.  numpy.ndarray.astype

Cast a numpy array to a specified type.    Notes  Deprecated since version 1.3.0: Using astype to convert from timezone-naive dtype to timezone-aware dtype is deprecated and will raise in a future version. Use Series.dt.tz_localize() instead.  Examples Create a DataFrame: 
>>> d = {'col1': [1, 2], 'col2': [3, 4]}
>>> df = pd.DataFrame(data=d)
>>> df.dtypes
col1    int64
col2    int64
dtype: object
  Cast all columns to int32: 
>>> df.astype('int32').dtypes
col1    int32
col2    int32
dtype: object
  Cast col1 to int32 using a dictionary: 
>>> df.astype({'col1': 'int32'}).dtypes
col1    int32
col2    int64
dtype: object
  Create a series: 
>>> ser = pd.Series([1, 2], dtype='int32')
>>> ser
0    1
1    2
dtype: int32
>>> ser.astype('int64')
0    1
1    2
dtype: int64
  Convert to categorical type: 
>>> ser.astype('category')
0    1
1    2
dtype: category
Categories (2, int64): [1, 2]
  Convert to ordered categorical type with custom ordering: 
>>> from pandas.api.types import CategoricalDtype
>>> cat_dtype = CategoricalDtype(
...     categories=[2, 1], ordered=True)
>>> ser.astype(cat_dtype)
0    1
1    2
dtype: category
Categories (2, int64): [2 < 1]
  Note that using copy=False and changing data on a new pandas object may propagate changes: 
>>> s1 = pd.Series([1, 2])
>>> s2 = s1.astype('int64', copy=False)
>>> s2[0] = 10
>>> s1  # note that s1[0] has changed too
0    10
1     2
dtype: int64
  Create a series of dates: 
>>> ser_date = pd.Series(pd.date_range('20200101', periods=3))
>>> ser_date
0   2020-01-01
1   2020-01-02
2   2020-01-03
dtype: datetime64[ns]
pandas.DataFrame.at   propertyDataFrame.at
 
Access a single value for a row/column label pair. Similar to loc, in that both provide label-based lookups. Use at if you only need to get or set a single value in a DataFrame or Series.  Raises 
 KeyError

If ‘label’ does not exist in DataFrame.      See also  DataFrame.iat

Access a single value for a row/column pair by integer position.  DataFrame.loc

Access a group of rows and columns by label(s).  Series.at

Access a single value using a label.    Examples 
>>> df = pd.DataFrame([[0, 2, 3], [0, 4, 1], [10, 20, 30]],
...                   index=[4, 5, 6], columns=['A', 'B', 'C'])
>>> df
    A   B   C
4   0   2   3
5   0   4   1
6  10  20  30
  Get value at specified row/column pair 
>>> df.at[4, 'B']
2
  Set value at specified row/column pair 
>>> df.at[4, 'B'] = 10
>>> df.at[4, 'B']
10
  Get value within a Series 
>>> df.loc[5].at['B']
4
pandas.DataFrame.at_time   DataFrame.at_time(time, asof=False, axis=None)[source]
 
Select values at particular time of day (e.g., 9:30AM).  Parameters 
 
time:datetime.time or str


axis:{0 or ‘index’, 1 or ‘columns’}, default 0

  Returns 
 Series or DataFrame
  Raises 
 TypeError

If the index is not a DatetimeIndex      See also  between_time

Select values between particular times of the day.  first

Select initial periods of time series based on a date offset.  last

Select final periods of time series based on a date offset.  DatetimeIndex.indexer_at_time

Get just the index locations for values at particular time of the day.    Examples 
>>> i = pd.date_range('2018-04-09', periods=4, freq='12H')
>>> ts = pd.DataFrame({'A': [1, 2, 3, 4]}, index=i)
>>> ts
                     A
2018-04-09 00:00:00  1
2018-04-09 12:00:00  2
2018-04-10 00:00:00  3
2018-04-10 12:00:00  4
  
>>> ts.at_time('12:00')
                     A
2018-04-09 12:00:00  2
2018-04-10 12:00:00  4
pandas.DataFrame.attrs   propertyDataFrame.attrs
 
Dictionary of global attributes of this dataset.  Warning attrs is experimental and may change without warning.   See also  DataFrame.flags

Global flags applying to this object.
pandas.DataFrame.axes   propertyDataFrame.axes
 
Return a list representing the axes of the DataFrame. It has the row axis labels and column axis labels as the only members. They are returned in that order. Examples 
>>> df = pd.DataFrame({'col1': [1, 2], 'col2': [3, 4]})
>>> df.axes
[RangeIndex(start=0, stop=2, step=1), Index(['col1', 'col2'],
dtype='object')]
pandas.DataFrame.backfill   DataFrame.backfill(axis=None, inplace=False, limit=None, downcast=None)[source]
 
Synonym for DataFrame.fillna() with method='bfill'.  Returns 
 Series/DataFrame or None

Object with missing values filled or None if inplace=True.
pandas.DataFrame.between_time   DataFrame.between_time(start_time, end_time, include_start=NoDefault.no_default, include_end=NoDefault.no_default, inclusive=None, axis=None)[source]
 
Select values between particular times of the day (e.g., 9:00-9:30 AM). By setting start_time to be later than end_time, you can get the times that are not between the two times.  Parameters 
 
start_time:datetime.time or str


Initial time as a time filter limit.  
end_time:datetime.time or str


End time as a time filter limit.  
include_start:bool, default True


Whether the start time needs to be included in the result.  Deprecated since version 1.4.0: Arguments include_start and include_end have been deprecated to standardize boundary inputs. Use inclusive instead, to set each bound as closed or open.   
include_end:bool, default True


Whether the end time needs to be included in the result.  Deprecated since version 1.4.0: Arguments include_start and include_end have been deprecated to standardize boundary inputs. Use inclusive instead, to set each bound as closed or open.   
inclusive:{“both”, “neither”, “left”, “right”}, default “both”


Include boundaries; whether to set each bound as closed or open.  
axis:{0 or ‘index’, 1 or ‘columns’}, default 0


Determine range time on index or columns value.    Returns 
 Series or DataFrame

Data from the original object filtered to the specified dates range.    Raises 
 TypeError

If the index is not a DatetimeIndex      See also  at_time

Select values at a particular time of the day.  first

Select initial periods of time series based on a date offset.  last

Select final periods of time series based on a date offset.  DatetimeIndex.indexer_between_time

Get just the index locations for values between particular times of the day.    Examples 
>>> i = pd.date_range('2018-04-09', periods=4, freq='1D20min')
>>> ts = pd.DataFrame({'A': [1, 2, 3, 4]}, index=i)
>>> ts
                     A
2018-04-09 00:00:00  1
2018-04-10 00:20:00  2
2018-04-11 00:40:00  3
2018-04-12 01:00:00  4
  
>>> ts.between_time('0:15', '0:45')
                     A
2018-04-10 00:20:00  2
2018-04-11 00:40:00  3
  You get the times that are not between two times by setting start_time later than end_time: 
>>> ts.between_time('0:45', '0:15')
                     A
2018-04-09 00:00:00  1
2018-04-12 01:00:00  4
pandas.DataFrame.bfill   DataFrame.bfill(axis=None, inplace=False, limit=None, downcast=None)[source]
 
Synonym for DataFrame.fillna() with method='bfill'.  Returns 
 Series/DataFrame or None

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