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
>>> 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
>>> 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.23 KB 2.33 KB 1.67 KB 10.33 KB 2.39 KB 1.73 KB Indexers 184 B 184 B 72 B 184 B 184 B 72 B Blocks 1.37 KB 1.41 KB 1.09 KB 1.37 KB 1.41 KB 1.09 KB Values 16 B 16 B 16 B 16 B 16 B 16 B Total 4.72 KB 4.87 KB 3.67 KB 12.81 KB 4.94 KB 3.73 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