Detail: IndexHierarchy: Attribute

Overview: IndexHierarchy: Attribute

IndexHierarchy.STATIC = True
>>> ih = sf.IndexHierarchy.from_labels((('a', 1024, '1517-04-01'), ('a', 2048, '1789-12-31'), ('b', 0, '1620-11-21')), index_constructors=(sf.Index, sf.Index, sf.IndexDate), name=('x', 'y', 'z'))
>>> ih.STATIC
True
IndexHierarchy.depth

Return the depth of the index hierarchy.

>>> ih = sf.IndexHierarchy.from_labels((('a', 1024, '1517-04-01'), ('a', 2048, '1789-12-31'), ('b', 0, '1620-11-21')), index_constructors=(sf.Index, sf.Index, sf.IndexDate), name=('x', 'y', 'z'))
>>> ih.depth
3
IndexHierarchy.dtypes

Return a Series of dytpes for each index depth.

Returns:

static_frame.Series

>>> ih = sf.IndexHierarchy.from_labels((('a', 1024, '1517-04-01'), ('a', 2048, '1789-12-31'), ('b', 0, '1620-11-21')), index_constructors=(sf.Index, sf.Index, sf.IndexDate), name=('x', 'y', 'z'))
>>> ih.dtypes
<Series>
<Index>
x        <U1
y        int64
z        datetime64[D]
<<U1>    <object>
IndexHierarchy.index_types

Return a Series of Index classes for each index depth.

Returns:

Series

>>> ih = sf.IndexHierarchy.from_labels((('a', 1024, '1517-04-01'), ('a', 2048, '1789-12-31'), ('b', 0, '1620-11-21')), index_constructors=(sf.Index, sf.Index, sf.IndexDate), name=('x', 'y', 'z'))
>>> ih.index_types
<Series>
<Index>
x        <Index>
y        <Index>
z        <IndexDate>
<<U1>    <object>
IndexHierarchy.memory

Return a MemoryDisplay, providing the size in memory of this object. For compound containers, component sizes will also be provided. Size can be interpreted through six combinations of three configurations:

L: Local: memory ignoring referenced array data provided via views. LM: Local Materialized: memory where arrays that are locally owned report their byte payload LMD: Local Materialized Data: locally owned memory of arrays byte payloads, excluding all other components

R: Referenced: memory including referenced array data provided via views RM: Referenced Materialized: memory where arrays that are locally owned or referenced report their byte payload RMD: Referenced Materialized Data: localy owned and referenced array byte payloads, excluding all other components

>>> ih = sf.IndexHierarchy.from_labels((('a', 1024, '1517-04-01'), ('a', 2048, '1789-12-31'), ('b', 0, '1620-11-21')), index_constructors=(sf.Index, sf.Index, sf.IndexDate), name=('x', 'y', 'z'))
>>> ih.memory
         L    Lu    LM   LMu   LMD  LMDu  R     Ru    RM   RMu   RMD  RMDu
Name     214  B     214  B     214  B     214   B     214  B     214  B
Indices  2.38 KB    2.47 KB    1.72 KB    10.49 KB    2.54 KB    1.79 KB
Indexers 200  B     200  B     72   B     200   B     200  B     72   B
Blocks   740  B     788  B     404  B     740   B     788  B     404  B
Values   16   B     16   B     16   B     16    B     16   B     16   B
Total    4.25 KB    4.41 KB    3.03 KB    12.36 KB    4.47 KB    3.09 KB
IndexHierarchy.mloc

The memory location, represented as an integer, of the underlying NumPy array.

IndexHierarchy.name

A hashable label attached to this container.

Returns:

Hashable

>>> ih = sf.IndexHierarchy.from_labels((('a', 1024, '1517-04-01'), ('a', 2048, '1789-12-31'), ('b', 0, '1620-11-21')), index_constructors=(sf.Index, sf.Index, sf.IndexDate), name=('x', 'y', 'z'))
>>> ih.name
('x', 'y', 'z')
IndexHierarchy.names

Provide a suitable iterable of names for usage in output formats that require a field name as string for the index.

>>> ih = sf.IndexHierarchy.from_labels((('a', 1024, '1517-04-01'), ('a', 2048, '1789-12-31'), ('b', 0, '1620-11-21')), index_constructors=(sf.Index, sf.Index, sf.IndexDate), name=('x', 'y', 'z'))
>>> ih.names
('x', 'y', 'z')
IndexHierarchy.nbytes

Return the total bytes of the underlying NumPy array.

Returns:

int

>>> ih = sf.IndexHierarchy.from_labels((('a', 1024, '1517-04-01'), ('a', 2048, '1789-12-31'), ('b', 0, '1620-11-21')), index_constructors=(sf.Index, sf.Index, sf.IndexDate), name=('x', 'y', 'z'))
>>> ih.nbytes
677
IndexHierarchy.ndim

Return the number of dimensions.

Returns:

int

>>> ih = sf.IndexHierarchy.from_labels((('a', 1024, '1517-04-01'), ('a', 2048, '1789-12-31'), ('b', 0, '1620-11-21')), index_constructors=(sf.Index, sf.Index, sf.IndexDate), name=('x', 'y', 'z'))
>>> ih.ndim
2
IndexHierarchy.positions

Return the immutable positions array.

>>> ih = sf.IndexHierarchy.from_labels((('a', 1024, '1517-04-01'), ('a', 2048, '1789-12-31'), ('b', 0, '1620-11-21')), index_constructors=(sf.Index, sf.Index, sf.IndexDate), name=('x', 'y', 'z'))
>>> ih.positions
[0 1 2]
IndexHierarchy.shape

Return a tuple describing the shape of the underlying NumPy array.

Returns:

tp.Tuple[int]

>>> ih = sf.IndexHierarchy.from_labels((('a', 1024, '1517-04-01'), ('a', 2048, '1789-12-31'), ('b', 0, '1620-11-21')), index_constructors=(sf.Index, sf.Index, sf.IndexDate), name=('x', 'y', 'z'))
>>> ih.shape
(3, 3)
IndexHierarchy.size

Return the size of the underlying NumPy array.

Returns:

int

>>> ih = sf.IndexHierarchy.from_labels((('a', 1024, '1517-04-01'), ('a', 2048, '1789-12-31'), ('b', 0, '1620-11-21')), index_constructors=(sf.Index, sf.Index, sf.IndexDate), name=('x', 'y', 'z'))
>>> ih.size
9

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