Expand description
Row-label / index machinery for frankenpandas — every
DataFrame and Series in fp-frame carries an Index that
pairs labels with positional row indices, plus the alignment
algebra that pandas users expect from Series + Series and
DataFrame.align().
§Core types
Index: the canonical row-label container. Internally a typedVec<IndexLabel>plus an O(1) label-lookup hashmap built lazily on first use. PandasIndexshape: monotonic probes, duplicate handling, range-style construction (Index::from_range(0..N)), name metadata.IndexLabel: typed label enum —Int64(i64),Float64(f64),Utf8(String),Bool(bool),Datetime64(i64),Timedelta64(i64). Lets oneIndexcarry mixed-type labels without erasing to strings.MultiIndex: hierarchical multi-level index for pandas-style row MultiIndex DataFrames. Each level is itself aVec<IndexLabel>plus an integer codes array.MultiIndexOrIndex: sum-type for code paths that accept either flatIndexorMultiIndex.DuplicateKeep: enum controllingkeep='first' | 'last' | Falsesemantics inIndex.duplicated/Index.drop_duplicatesetc.
§Alignment algebra
Binary ops between two pandas-shaped frames need to align rows
by label. The aligner builds an AlignmentPlan (or
MultiAlignmentPlan for N-way joins) that the caller then
applies to each side’s value buffers:
aligndispatches onAlignMode(Left,Right,Inner,Outer).align_inner,align_left,align_union: direct single-mode entry points.leapfrog_union/leapfrog_intersection: N-way row alignment via a leapfrog merge over already-sorted indexes (used bymulti_way_align).validate_alignment_plan: sanity check (lengths match, indices in bounds).
§Date / time helpers
Pandas pd.date_range / pd.timedelta_range analogs:
timedelta_range: pandas-style timedelta range builder.apply_date_offset/apply_date_offset_to_nanos: evaluate aDateOffsetagainst an anchor timestamp.infer_freq/infer_freq_from_timestamps/infer_freq_from_nanos: pandas-style frequency inference from a sample of timestamps.format_datetime_ns: render a nanosecond-since-epoch i64 as the canonicalYYYY-MM-DD HH:MM:SS[.f]string used in IndexLabel display and IO formatters.
§Error reporting
IndexError: structural / lookup failures (not-monotonic, not-unique, missing-label, validation-mismatch).TimedeltaRangeError/DateRangeError: range builder parse / step / overflow errors.
§Relationship to other crates
Structs§
- Alignment
Plan - Categorical
Index - Public pandas-style categorical index wrapper.
- Datetime
Index - Public pandas-style datetime index wrapper.
- Index
- Index
String Accessor - Multi
Alignment Plan - Result of multi-way alignment: a union index plus per-input position vectors.
- Multi
Index - A hierarchical (multi-level) index for DataFrames and Series.
- Period
Fields - Period
Index - Public pandas-style period index wrapper.
- Range
Index - Public pandas-style range index wrapper.
- Timedelta
Index - Public pandas-style timedelta index wrapper.
Enums§
- Align
Mode - Alignment mode for index-level join semantics.
- Date
Offset - A small subset of pandas
pandas.tseries.offsetsdate offsets. - Date
Range Error - Error for date_range parameter combinations.
- Duplicate
Keep - Index
Error - Index
Label - Multi
Index OrIndex - Result of
MultiIndex::droplevel— either a MultiIndex (if 2+ levels remain) or a plain Index (if reduced to 1 level). - Timedelta
Range Error - Error for timedelta_range parameter combinations.
Functions§
- align
- Align two indexes using the specified join mode.
- align_
inner - Inner alignment: only labels present in both indexes.
- align_
left - Left alignment: all left labels preserved, right fills with None for missing.
- align_
union - apply_
date_ offset - Apply a date offset to a timestamp string and return nanoseconds since epoch.
- apply_
date_ offset_ to_ nanos - Apply a date offset to a nanosecond timestamp.
- bdate_
range - Create a DatetimeIndex with default weekday-only business-day values.
- date_
range - Create a DatetimeIndex with evenly spaced values.
- format_
datetime_ ns - infer_
freq - Infer a pandas-style frequency string from a DatetimeIndex.
- infer_
freq_ from_ nanos - Infer a pandas-style frequency string from nanosecond timestamps.
- infer_
freq_ from_ timestamps - Infer a pandas-style frequency string from timestamp strings.
- leapfrog_
intersection - Leapfrog intersection: labels present in ALL input indexes.
- leapfrog_
union - K-way merge union of multiple sorted iterators.
- multi_
way_ align - Multi-way alignment: union all indexes, then compute position vectors.
- timedelta_
range - Create a TimedeltaIndex with evenly spaced values.
- validate_
alignment_ plan