Detail: IndexYearGO: Constructor#
Overview: IndexYearGO: Constructor
- IndexYearGO.__init__(labels, /, *, loc_is_iloc=False, name=<object object>, sort_status=SortStatus.UNKNOWN)#
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_difference(*others)#
Construct a new Index based on the difference with Index, containers, or NumPy arrays. Retains order.
>>> ix1 = sf.IndexYearGO.from_labels(('1517', '1520', '1518')) >>> ix1 <IndexYearGO> 1517 1520 1518 <datetime64[Y]> >>> ix2 = sf.IndexYearGO.from_labels(('2022', '2021', '2018')) >>> ix2 <IndexYearGO> 2022 2021 2018 <datetime64[Y]> >>> sf.IndexYearGO.from_difference(ix1, ix2) <IndexYearGO> 1517 1520 1518 <datetime64[Y]>
- classmethod IndexYearGO.from_intersection(*others)#
Construct a new Index based on the intersection with Index, containers, or NumPy arrays. Identical comparisons retain order.
>>> ix1 = sf.IndexYearGO.from_labels(('1517', '1520', '1518')) >>> ix1 <IndexYearGO> 1517 1520 1518 <datetime64[Y]> >>> ix2 = sf.IndexYearGO.from_labels(('2022', '2021', '2018')) >>> ix2 <IndexYearGO> 2022 2021 2018 <datetime64[Y]> >>> sf.IndexYearGO.from_intersection(ix1, ix2) <IndexYearGO> <datetime64[Y]>
- classmethod IndexYearGO.from_labels(labels, /, *, name=None)#
Construct an
Indexfrom an iterable of labels, where each label is a hashable. Provided for a compatible interface toIndexHierarchy.>>> 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_union(*others)#
Construct a new Index based on the union with Index, containers, or NumPy arrays. Identical comparisons retain order.
>>> ix1 = sf.IndexYearGO.from_labels(('1517', '1520', '1518')) >>> ix1 <IndexYearGO> 1517 1520 1518 <datetime64[Y]> >>> ix2 = sf.IndexYearGO.from_labels(('2022', '2021', '2018')) >>> ix2 <IndexYearGO> 2022 2021 2018 <datetime64[Y]> >>> sf.IndexYearGO.from_union(ix1, ix2) <IndexYearGO> 1517 1518 1520 2018 2021 2022 <datetime64[Y]>
- 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