neulab/docprompting-conala huggingface dataset:
pandas.Series.dt.tz_convert   Series.dt.tz_convert(*args, **kwargs)[source]
 
Convert tz-aware Datetime Array/Index from one time zone to another.  Parameters 
 
tz:str, pytz.timezone, dateutil.tz.tzfile or None


Time zone for time. Corresponding timestamps would be converted to this time zone of the Datetime Array/Index. A tz of None will convert to UTC and remove the timezone information.    Returns 
 Array or Index
  Raises 
 TypeError

If Datetime Array/Index is tz-naive.      See also  DatetimeIndex.tz

A timezone that has a variable offset from UTC.  DatetimeIndex.tz_localize

Localize tz-naive DatetimeIndex to a given time zone, or remove timezone from a tz-aware DatetimeIndex.    Examples With the tz parameter, we can change the DatetimeIndex to other time zones: 
>>> dti = pd.date_range(start='2014-08-01 09:00',
...                     freq='H', periods=3, tz='Europe/Berlin')
  
>>> dti
DatetimeIndex(['2014-08-01 09:00:00+02:00',
               '2014-08-01 10:00:00+02:00',
               '2014-08-01 11:00:00+02:00'],
              dtype='datetime64[ns, Europe/Berlin]', freq='H')
  
>>> dti.tz_convert('US/Central')
DatetimeIndex(['2014-08-01 02:00:00-05:00',
               '2014-08-01 03:00:00-05:00',
               '2014-08-01 04:00:00-05:00'],
              dtype='datetime64[ns, US/Central]', freq='H')
  With the tz=None, we can remove the timezone (after converting to UTC if necessary): 
>>> dti = pd.date_range(start='2014-08-01 09:00', freq='H',
...                     periods=3, tz='Europe/Berlin')
  
>>> dti
DatetimeIndex(['2014-08-01 09:00:00+02:00',
               '2014-08-01 10:00:00+02:00',
               '2014-08-01 11:00:00+02:00'],
                dtype='datetime64[ns, Europe/Berlin]', freq='H')
  
>>> dti.tz_convert(None)
DatetimeIndex(['2014-08-01 07:00:00',
               '2014-08-01 08:00:00',
               '2014-08-01 09:00:00'],
                dtype='datetime64[ns]', freq='H')
pandas.Series.dt.week   Series.dt.week
 
The week ordinal of the year.  Deprecated since version 1.1.0.  Series.dt.weekofyear and Series.dt.week have been deprecated. Please use Series.dt.isocalendar().week instead.
pandas.Series.dt.weekday   Series.dt.weekday
 
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.weekofyear   Series.dt.weekofyear
 
The week ordinal of the year.  Deprecated since version 1.1.0.  Series.dt.weekofyear and Series.dt.week have been deprecated. Please use Series.dt.isocalendar().week instead.
pandas.Series.dt.year   Series.dt.year
 
The year of the datetime. Examples 
>>> datetime_series = pd.Series(
...     pd.date_range("2000-01-01", periods=3, freq="Y")
... )
>>> datetime_series
0   2000-12-31
1   2001-12-31
2   2002-12-31
dtype: datetime64[ns]
>>> datetime_series.dt.year
0    2000
1    2001
2    2002
dtype: int64
pandas.Series.dtype   propertySeries.dtype
 
Return the dtype object of the underlying data.
pandas.Series.dtypes   propertySeries.dtypes
 
Return the dtype object of the underlying data.
pandas.Series.duplicated   Series.duplicated(keep='first')[source]
 
Indicate duplicate Series values. Duplicated values are indicated as True values in the resulting Series. Either all duplicates, all except the first or all except the last occurrence of duplicates can be indicated.  Parameters 
 
keep:{‘first’, ‘last’, False}, default ‘first’


Method to handle dropping duplicates:  ‘first’ : Mark duplicates as True except for the first occurrence. ‘last’ : Mark duplicates as True except for the last occurrence. False : Mark all duplicates as True.     Returns 
 Series[bool]

Series indicating whether each value has occurred in the preceding values.      See also  Index.duplicated

Equivalent method on pandas.Index.  DataFrame.duplicated

Equivalent method on pandas.DataFrame.  Series.drop_duplicates

Remove duplicate values from Series.    Examples By default, for each set of duplicated values, the first occurrence is set on False and all others on True: 
>>> animals = pd.Series(['lama', 'cow', 'lama', 'beetle', 'lama'])
>>> animals.duplicated()
0    False
1    False
2     True
3    False
4     True
dtype: bool
  which is equivalent to 
>>> animals.duplicated(keep='first')
0    False
1    False
2     True
3    False
4     True
dtype: bool
  By using ‘last’, the last occurrence of each set of duplicated values is set on False and all others on True: 
>>> animals.duplicated(keep='last')
0     True
1    False
2     True
3    False
4    False
dtype: bool
  By setting keep on False, all duplicates are True: 
>>> animals.duplicated(keep=False)
0     True
1    False
2     True
3    False
4     True
dtype: bool
pandas.Series.empty   propertySeries.empty
 
Indicator whether Series/DataFrame is empty. True if Series/DataFrame is entirely empty (no items), meaning any of the axes are of length 0.  Returns 
 bool

If Series/DataFrame is empty, return True, if not return False.      See also  Series.dropna

Return series without null values.  DataFrame.dropna

Return DataFrame with labels on given axis omitted where (all or any) data are missing.    Notes If Series/DataFrame contains only NaNs, it is still not considered empty. See the example below. Examples An example of an actual empty DataFrame. Notice the index is empty: 
>>> df_empty = pd.DataFrame({'A' : []})
>>> df_empty
Empty DataFrame
Columns: [A]
Index: []
>>> df_empty.empty
True
  If we only have NaNs in our DataFrame, it is not considered empty! We will need to drop the NaNs to make the DataFrame empty: 
>>> df = pd.DataFrame({'A' : [np.nan]})
>>> df
    A
0 NaN
>>> df.empty
False
>>> df.dropna().empty
True
  
>>> ser_empty = pd.Series({'A' : []})
>>> ser_empty
A    []
dtype: object
>>> ser_empty.empty
False
>>> ser_empty = pd.Series()
>>> ser_empty.empty
True
pandas.Series.eq   Series.eq(other, level=None, fill_value=None, axis=0)[source]
 
Return Equal to of series and other, element-wise (binary operator eq). 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.     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.eq(b, fill_value=0)
a     True
b    False
c    False
d    False
e    False
dtype: bool
pandas.Series.equals   Series.equals(other)[source]
 
Test whether two objects contain the same elements. This function allows two Series or DataFrames to be compared against each other to see if they have the same shape and elements. NaNs in the same location are considered equal. The row/column index do not need to have the same type, as long as the values are considered equal. Corresponding columns must be of the same dtype.  Parameters 
 
other:Series or DataFrame


The other Series or DataFrame to be compared with the first.    Returns 
 bool

True if all elements are the same in both objects, False otherwise.      See also  Series.eq

Compare two Series objects of the same length and return a Series where each element is True if the element in each Series is equal, False otherwise.  DataFrame.eq

Compare two DataFrame objects of the same shape and return a DataFrame where each element is True if the respective element in each DataFrame is equal, False otherwise.  testing.assert_series_equal

Raises an AssertionError if left and right are not equal. Provides an easy interface to ignore inequality in dtypes, indexes and precision among others.  testing.assert_frame_equal

Like assert_series_equal, but targets DataFrames.  numpy.array_equal

Return True if two arrays have the same shape and elements, False otherwise.    Examples 
>>> df = pd.DataFrame({1: [10], 2: [20]})
>>> df
    1   2
0  10  20
  DataFrames df and exactly_equal have the same types and values for their elements and column labels, which will return True. 
>>> exactly_equal = pd.DataFrame({1: [10], 2: [20]})
>>> exactly_equal
    1   2
0  10  20
>>> df.equals(exactly_equal)
True
  DataFrames df and different_column_type have the same element types and values, but have different types for the column labels, which will still return True. 
>>> different_column_type = pd.DataFrame({1.0: [10], 2.0: [20]})
>>> different_column_type
   1.0  2.0
0   10   20
>>> df.equals(different_column_type)
True
  DataFrames df and different_data_type have different types for the same values for their elements, and will return False even though their column labels are the same values and types. 
>>> different_data_type = pd.DataFrame({1: [10.0], 2: [20.0]})
>>> different_data_type
      1     2
0  10.0  20.0
>>> df.equals(different_data_type)
False
pandas.Series.expanding   Series.expanding(min_periods=1, center=None, axis=0, method='single')[source]
 
Provide expanding window calculations.  Parameters 
 
min_periods:int, default 1


Minimum number of observations in window required to have a value; otherwise, result is np.nan.  
center:bool, default False


If False, set the window labels as the right edge of the window index. If True, set the window labels as the center of the window index.  Deprecated since version 1.1.0.   
axis:int or str, default 0


If 0 or 'index', roll across the rows. If 1 or 'columns', roll across the columns.  
method:str {‘single’, ‘table’}, default ‘single’


Execute the rolling operation per single column or row ('single') or over the entire object ('table'). This argument is only implemented when specifying engine='numba' in the method call.  New in version 1.3.0.     Returns 
 
Expanding subclass
    See also  rolling

Provides rolling window calculations.  ewm

Provides exponential weighted functions.    Notes See Windowing Operations for further usage details and examples. Examples 
>>> df = pd.DataFrame({"B": [0, 1, 2, np.nan, 4]})
>>> df
     B
0  0.0
1  1.0
2  2.0
3  NaN
4  4.0
  min_periods Expanding sum with 1 vs 3 observations needed to calculate a value. 
>>> df.expanding(1).sum()
     B
0  0.0
1  1.0
2  3.0
3  3.0
4  7.0
>>> df.expanding(3).sum()
     B
0  NaN
1  NaN
2  3.0
3  3.0
4  7.0
pandas.Series.explode   Series.explode(ignore_index=False)[source]
 
Transform each element of a list-like to a row.  New in version 0.25.0.   Parameters 
 
ignore_index:bool, default False


If True, the resulting index will be labeled 0, 1, …, n - 1.  New in version 1.1.0.     Returns 
 Series

Exploded lists to rows; index will be duplicated for these rows.      See also  Series.str.split

Split string values on specified separator.  Series.unstack

Unstack, a.k.a. pivot, Series with MultiIndex to produce DataFrame.  DataFrame.melt

Unpivot a DataFrame from wide format to long format.  DataFrame.explode

Explode a DataFrame from list-like columns to long format.    Notes This routine will explode list-likes including lists, tuples, sets, Series, and np.ndarray. The result dtype of the subset rows will be object. Scalars will be returned unchanged, and empty list-likes will result in a np.nan for that row. In addition, the ordering of elements in the output will be non-deterministic when exploding sets. Examples 
>>> s = pd.Series([[1, 2, 3], 'foo', [], [3, 4]])
>>> s
0    [1, 2, 3]
1          foo
2           []
3       [3, 4]
dtype: object
  
>>> s.explode()
0      1
0      2
0      3
1    foo
2    NaN
3      3
3      4
dtype: object
pandas.Series.ffill   Series.ffill(axis=None, inplace=False, limit=None, downcast=None)[source]
 
Synonym for DataFrame.fillna() with method='ffill'.  Returns 
 Series/DataFrame or None

Object with missing values filled or None if inplace=True.
pandas.Series.filter   Series.filter(items=None, like=None, regex=None, axis=None)[source]
 
Subset the dataframe rows or columns according to the specified index labels. Note that this routine does not filter a dataframe on its contents. The filter is applied to the labels of the index.  Parameters 
 
items:list-like


Keep labels from axis which are in items.  
like:str


Keep labels from axis for which “like in label == True”.  
regex:str (regular expression)


Keep labels from axis for which re.search(regex, label) == True.  
axis:{0 or ‘index’, 1 or ‘columns’, None}, default None


The axis to filter on, expressed either as an index (int) or axis name (str). By default this is the info axis, ‘index’ for Series, ‘columns’ for DataFrame.    Returns 
 same type as input object
    See also  DataFrame.loc

Access a group of rows and columns by label(s) or a boolean array.    Notes The items, like, and regex parameters are enforced to be mutually exclusive. axis defaults to the info axis that is used when indexing with []. Examples 
>>> df = pd.DataFrame(np.array(([1, 2, 3], [4, 5, 6])),
...                   index=['mouse', 'rabbit'],
...                   columns=['one', 'two', 'three'])
>>> df
        one  two  three
mouse     1    2      3
rabbit    4    5      6
  
>>> # select columns by name
>>> df.filter(items=['one', 'three'])
         one  three
mouse     1      3
rabbit    4      6
  
>>> # select columns by regular expression
>>> df.filter(regex='e$', axis=1)
         one  three
mouse     1      3
rabbit    4      6
  
>>> # select rows containing 'bbi'
>>> df.filter(like='bbi', axis=0)
         one  two  three
rabbit    4    5      6
pandas.Series.first   Series.first(offset)[source]
 
Select initial periods of time series data based on a date offset. When having a DataFrame with dates as index, this function can select the first few rows based on a date offset.  Parameters 
 
offset:str, DateOffset or dateutil.relativedelta


The offset length of the data that will be selected. For instance, ‘1M’ will display all the rows having their index within the first month.    Returns 
 Series or DataFrame

A subset of the caller.    Raises 
 TypeError

If the index is not a DatetimeIndex      See also  last

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

Select values at a particular time of the day.  between_time

Select values between particular times of the day.    Examples 
>>> i = pd.date_range('2018-04-09', periods=4, freq='2D')
>>> ts = pd.DataFrame({'A': [1, 2, 3, 4]}, index=i)
>>> ts
            A
2018-04-09  1
2018-04-11  2
2018-04-13  3
2018-04-15  4
  Get the rows for the first 3 days: 
>>> ts.first('3D')
            A
2018-04-09  1
2018-04-11  2
  Notice the data for 3 first calendar days were returned, not the first 3 days observed in the dataset, and therefore data for 2018-04-13 was not returned.
pandas.Series.first_valid_index   Series.first_valid_index()[source]
 
Return index for first non-NA value or None, if no NA value is found.  Returns 
 
scalar:type of index

   Notes If all elements are non-NA/null, returns None. Also returns None for empty Series/DataFrame.
pandas.Series.flags   propertySeries.flags
 
Get the properties associated with this pandas object. The available flags are  Flags.allows_duplicate_labels   See also  Flags

Flags that apply to pandas objects.  DataFrame.attrs

Global metadata applying to this dataset.    Notes “Flags” differ from “metadata”. Flags reflect properties of the pandas object (the Series or DataFrame). Metadata refer to properties of the dataset, and should be stored in DataFrame.attrs. Examples 
>>> df = pd.DataFrame({"A": [1, 2]})
>>> df.flags
<Flags(allows_duplicate_labels=True)>
  Flags can be get or set using . 
>>> df.flags.allows_duplicate_labels
True
>>> df.flags.allows_duplicate_labels = False
  Or by slicing with a key 
>>> df.flags["allows_duplicate_labels"]
False
>>> df.flags["allows_duplicate_labels"] = True
pandas.Series.floordiv   Series.floordiv(other, level=None, fill_value=None, axis=0)[source]
 
Return Integer division of series and other, element-wise (binary operator floordiv). 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.rfloordiv

Reverse of the Integer 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.floordiv(b, fill_value=0)
a    1.0
b    NaN
c    NaN
d    0.0
e    NaN
dtype: float64
pandas.Series.ge   Series.ge(other, level=None, fill_value=None, axis=0)[source]
 
Return Greater than or equal to of series and other, element-wise (binary operator ge). 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.     Examples 
>>> a = pd.Series([1, 1, 1, np.nan, 1], index=['a', 'b', 'c', 'd', 'e'])
>>> a
a    1.0
b    1.0
c    1.0
d    NaN
e    1.0
dtype: float64
>>> b = pd.Series([0, 1, 2, np.nan, 1], index=['a', 'b', 'c', 'd', 'f'])
>>> b
a    0.0
b    1.0
c    2.0
d    NaN
f    1.0
dtype: float64
>>> a.ge(b, fill_value=0)
a     True
b     True
c    False
d    False
e     True
f    False
dtype: bool
pandas.Series.get   Series.get(key, default=None)[source]
 
Get item from object for given key (ex: DataFrame column). Returns default value if not found.  Parameters 
 
key:object

  Returns 
 
value:same type as items contained in object

   Examples 
>>> df = pd.DataFrame(
...     [
...         [24.3, 75.7, "high"],
...         [31, 87.8, "high"],
...         [22, 71.6, "medium"],
...         [35, 95, "medium"],
...     ],
...     columns=["temp_celsius", "temp_fahrenheit", "windspeed"],
...     index=pd.date_range(start="2014-02-12", end="2014-02-15", freq="D"),
... )
  
>>> df
            temp_celsius  temp_fahrenheit windspeed
2014-02-12          24.3             75.7      high
2014-02-13          31.0             87.8      high
2014-02-14          22.0             71.6    medium
2014-02-15          35.0             95.0    medium
  
>>> df.get(["temp_celsius", "windspeed"])
            temp_celsius windspeed
2014-02-12          24.3      high
2014-02-13          31.0      high
2014-02-14          22.0    medium
2014-02-15          35.0    medium
  If the key isn’t found, the default value will be used. 
>>> df.get(["temp_celsius", "temp_kelvin"], default="default_value")
'default_value'
pandas.Series.gt   Series.gt(other, level=None, fill_value=None, axis=0)[source]
 
Return Greater than of series and other, element-wise (binary operator gt). 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.     Examples 
>>> a = pd.Series([1, 1, 1, np.nan, 1], index=['a', 'b', 'c', 'd', 'e'])
>>> a
a    1.0
b    1.0
c    1.0
d    NaN
e    1.0
dtype: float64
>>> b = pd.Series([0, 1, 2, np.nan, 1], index=['a', 'b', 'c', 'd', 'f'])
>>> b
a    0.0
b    1.0
c    2.0
d    NaN
f    1.0
dtype: float64
>>> a.gt(b, fill_value=0)
a     True
b    False
c    False
d    False
e     True
f    False
dtype: bool
pandas.Series.hasnans   propertySeries.hasnans
 
Return True if there are any NaNs. Enables various performance speedups.
pandas.Series.head   Series.head(n=5)[source]
 
Return the first n rows. This function returns the first n rows for the object based on position. It is useful for quickly testing if your object has the right type of data in it. For negative values of n, this function returns all rows except the last n rows, equivalent to df[:-n].  Parameters 
 
n:int, default 5


Number of rows to select.    Returns 
 same type as caller

The first n rows of the caller object.      See also  DataFrame.tail

Returns the last n rows.    Examples 
>>> df = pd.DataFrame({'animal': ['alligator', 'bee', 'falcon', 'lion',
...                    'monkey', 'parrot', 'shark', 'whale', 'zebra']})
>>> df
      animal
0  alligator
1        bee
2     falcon
3       lion
4     monkey
5     parrot
6      shark
7      whale
8      zebra
  Viewing the first 5 lines 
>>> df.head()
      animal
0  alligator
1        bee
2     falcon
3       lion
4     monkey
  Viewing the first n lines (three in this case) 
>>> df.head(3)
      animal
0  alligator
1        bee
2     falcon
  For negative values of n 
>>> df.head(-3)
      animal
0  alligator
1        bee
2     falcon
3       lion
4     monkey
5     parrot