fips.indexes.outer_align_levels#

fips.indexes.outer_align_levels(dfs, axis=0, fill_value=nan)[source]#

Align MultiIndexes by performing an OUTER JOIN on level names.

Strictly preserves the order of appearance (First-Seen Priority).

Parameters:
  • dfs (list of pd.DataFrame) – The DataFrames to align.

  • axis (int or 'both', default 0) – The axis along which to align the DataFrames. 0 or ‘index’ for row alignment, 1 or ‘columns’ for column alignment, ‘both’ for both axes.

  • fill_value (scalar, default np.nan) – The value to use for missing entries after alignment. By default, missing entries are filled with NaN.

Returns:

A list of DataFrames with aligned MultiIndexes along the specified axis.

Return type:

list of pd.DataFrame