Hi I'm trying to do a lot of work with mapped func...
# ask-community
c
Hi I'm trying to do a lot of work with mapped functions. How do i merge the results of 2 tasks together? For example
imputed_categorical_dfs
returns two objects. I need to merge these with another task which does the same.
Copy code
My code which does not work.
transformed_df_map = merge_transformed_data.map(
        df1=[*imputed_categorical_dfs, *encoded_df_map],
        df2=[*imputed_numeric_dfs] + [*yeo_johnson_dfs],
    )
z
Hi @Crawford Collins! You should be able to merge the results of two tasks with another task, like in the link below. Does an approach like this seem like it might work for you? If not, happy to dig deeper if you can provide some pseudocode. https://docs.prefect.io/core/concepts/mapping.html#prefect-approach
c
Thanks, I figured it out. Never needed to unpack anything.:
Copy code
transformed_df_map = merge_transformed_data.map(
        df1=imputed_categorical_dfs + encoded_df_map,
        df2=imputed_numeric_dfs + yeo_johnson_dfs
    )
👍 1
z
Glad to hear it!