On The Default/fill Value For Outer Joins March 21, 2024 Post a Comment Below are teeny/toy versions of much larger/complex dataframes I'm working with: >>> A key u v w x 0 a 0.757954 0.258917 0.404934 0Solution 1: You can fill zeros after the merge:res = pd.merge(A, B, how="outer") res.loc[~res.key.isin(A.key), A.columns] = 0CopyEDITto skip key column:res.loc[~res.key.isin(A.key), A.columns.drop("key")] = 0Copy Share Post a Comment for "On The Default/fill Value For Outer Joins"
Post a Comment for "On The Default/fill Value For Outer Joins"