Detail: IndexNanosecond: Constructor#
Overview: IndexNanosecond: Constructor
- IndexNanosecond.__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.IndexNanosecond(('1789-05-05', '1789-12-31', '1799-11-09')) <IndexNanosecond> 1789-05-05T00:00:00.000000000 1789-12-31T00:00:00.000000000 1799-11-09T00:00:00.000000000 <datetime64[ns]>
- classmethod IndexNanosecond.from_difference(*others)#
Construct a new Index based on the difference with Index, containers, or NumPy arrays. Retains order.
>>> ix1 = sf.IndexNanosecond.from_labels(('1789-05-05', '1789-12-31', '1799-11-09')) >>> ix1 <IndexNanosecond> 1789-05-05T00:00:00.000000000 1789-12-31T00:00:00.000000000 1799-11-09T00:00:00.000000000 <datetime64[ns]> >>> ix2 = sf.IndexNanosecond.from_labels(('2022-04-01', '2021-12-31', '2018-06-30')) >>> ix2 <IndexNanosecond> 2022-04-01T00:00:00.000000000 2021-12-31T00:00:00.000000000 2018-06-30T00:00:00.000000000 <datetime64[ns]> >>> sf.IndexNanosecond.from_difference(ix1, ix2) <IndexNanosecond> 1789-05-05T00:00:00.000000000 1789-12-31T00:00:00.000000000 1799-11-09T00:00:00.000000000 <datetime64[ns]>
- classmethod IndexNanosecond.from_intersection(*others)#
Construct a new Index based on the intersection with Index, containers, or NumPy arrays. Identical comparisons retain order.
>>> ix1 = sf.IndexNanosecond.from_labels(('1789-05-05', '1789-12-31', '1799-11-09')) >>> ix1 <IndexNanosecond> 1789-05-05T00:00:00.000000000 1789-12-31T00:00:00.000000000 1799-11-09T00:00:00.000000000 <datetime64[ns]> >>> ix2 = sf.IndexNanosecond.from_labels(('2022-04-01', '2021-12-31', '2018-06-30')) >>> ix2 <IndexNanosecond> 2022-04-01T00:00:00.000000000 2021-12-31T00:00:00.000000000 2018-06-30T00:00:00.000000000 <datetime64[ns]> >>> sf.IndexNanosecond.from_intersection(ix1, ix2) <IndexNanosecond> <datetime64[ns]>
- classmethod IndexNanosecond.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.IndexNanosecond.from_labels(('1789-05-05', '1789-12-31', '1799-11-09')) <IndexNanosecond> 1789-05-05T00:00:00.000000000 1789-12-31T00:00:00.000000000 1799-11-09T00:00:00.000000000 <datetime64[ns]>
- classmethod IndexNanosecond.from_pandas(value, /)#
Given a Pandas index, return the appropriate IndexBase derived class.
>>> ix = pd.Index(('1789-05-05', '1789-12-31', '1799-11-09')) >>> sf.IndexNanosecond.from_pandas(ix) <Index> 1789-05-05 1789-12-31 1799-11-09 <object>
- classmethod IndexNanosecond.from_union(*others)#
Construct a new Index based on the union with Index, containers, or NumPy arrays. Identical comparisons retain order.
>>> ix1 = sf.IndexNanosecond.from_labels(('1789-05-05', '1789-12-31', '1799-11-09')) >>> ix1 <IndexNanosecond> 1789-05-05T00:00:00.000000000 1789-12-31T00:00:00.000000000 1799-11-09T00:00:00.000000000 <datetime64[ns]> >>> ix2 = sf.IndexNanosecond.from_labels(('2022-04-01', '2021-12-31', '2018-06-30')) >>> ix2 <IndexNanosecond> 2022-04-01T00:00:00.000000000 2021-12-31T00:00:00.000000000 2018-06-30T00:00:00.000000000 <datetime64[ns]> >>> sf.IndexNanosecond.from_union(ix1, ix2) <IndexNanosecond> 1789-05-05T00:00:00.000000000 1789-12-31T00:00:00.000000000 1799-11-09T00:00:00.000000000 2018-06-30T00:00:00.000000000 2021-12-31T00:00:00.000000000 2022-04-01T00:00:00.000000000 <datetime64[ns]>
IndexNanosecond: 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