@@ -838,7 +838,11 @@ def update_index_levels(
838838 def update_index_levels_from_other (
839839 self ,
840840 update_sources : dict [
841- Any , tuple [Any , Callable [[Any ], Any ] | dict [Any , Any ] | pd .Series [Any ]]
841+ Any ,
842+ tuple [
843+ Any | tuple [Any , ...],
844+ Callable [[Any ], Any ] | dict [Any , Any ] | pd .Series [Any ],
845+ ],
842846 ],
843847 copy : bool = True ,
844848 remove_unused_levels : bool = True ,
@@ -849,18 +853,29 @@ def update_index_levels_from_other(
849853 Parameters
850854 ----------
851855 update_sources
852- Updates to apply to `df` 's index
856+ Updates to apply to the data 's index
853857
854858 Each key is the level to which the updates will be applied
855859 (or the level that will be created if it doesn't already exist).
856860
857- Each value is a tuple of which the first element
861+ There are two options for the values.
862+
863+ The first is used when only one level is used to update the 'target level'.
864+ In this case, each value is a tuple of which the first element
858865 is the level to use to generate the values (the 'source level')
859866 and the second is mapper of the form used by
860867 [pd.Index.map][pandas.Index.map]
861868 which will be applied to the source level
862869 to update/create the level of interest.
863870
871+ Each value is a tuple of which the first element
872+ is the level or levels (if a tuple)
873+ to use to generate the values (the 'source level')
874+ and the second is mapper of the form used by
875+ [pd.Index.map][pandas.Index.map]
876+ which will be applied to the source level
877+ to update/create the level of interest.
878+
864879 copy
865880 Should the [pd.DataFrame][pandas.DataFrame] be copied before returning?
866881
0 commit comments