Detail: IndexYearGO: Constructor

Overview: IndexYearGO: Constructor

IndexYearGO.__init__(labels, *, loc_is_iloc=False, name=<object object>)

Initializer.

Parameters:
  • labels – Iterable of hashable values to be used as the index labels. If strings, NumPy datetime conversions will be applied.

  • name – A hashable object to label the container.

>>> sf.IndexYearGO(('1517', '1520', '1518'))
<IndexYearGO>
1517
1520
1518
<datetime64[Y]>
classmethod IndexYearGO.from_date_range(start, stop, step=1, *, name=None)

Get an IndexYearMonth instance over a range of dates, where start and stop are inclusive.

>>> sf.IndexYearGO.from_date_range('2021-12-30', '2022-01-02')
<IndexYearGO>
2021
2022
<datetime64[Y]>
classmethod IndexYearGO.from_labels(labels, *, name=None)

Construct an Index from an iterable of labels, where each label is a hashable. Provided for a compatible interface to IndexHierarchy.

>>> sf.IndexYearGO.from_labels(('1517', '1520', '1518'))
<IndexYearGO>
1517
1520
1518
<datetime64[Y]>
classmethod IndexYearGO.from_pandas(value)

Given a Pandas index, return the appropriate IndexBase derived class.

>>> ix = pd.Index(('1517', '1520', '1518'))
>>> sf.IndexYearGO.from_pandas(ix)
<IndexGO>
1517
1520
1518
<object>
classmethod IndexYearGO.from_year_month_range(start, stop, step=1, *, name=None)

Get an IndexYearMonth instance over a range of months, where start and end are inclusive.

>>> sf.IndexYearGO.from_year_month_range('2021-12', '2022-01')
<IndexYearGO>
2021
2022
<datetime64[Y]>
classmethod IndexYearGO.from_year_range(start, stop, step=1, *, name=None)

Get an IndexDate instance over a range of years, where start and end are inclusive.

>>> sf.IndexYearGO.from_year_range('2021', '2022')
<IndexYearGO>
2021
2022
<datetime64[Y]>

IndexYearGO: Constructor | Exporter | Attribute | Method | Dictionary-Like | Display | Selector | Iterator | Operator Binary | Operator Unary | Accessor Values | Accessor Datetime | Accessor String | Accessor Regular Expression | Accessor Hashlib | Accessor Type Clinic