MCPcopy Create free account
hub / github.com/dask/dask / join

Method join

dask/dataframe/dask_expr/_collection.py:2981–3026  ·  view source on GitHub ↗
(
        self,
        other,
        on=None,
        how="left",
        lsuffix="",
        rsuffix="",
        shuffle_method=None,
        npartitions=None,
    )

Source from the content-addressed store, hash-verified

2979
2980 @derived_from(pd.DataFrame)
2981 def join(
2982 self,
2983 other,
2984 on=None,
2985 how="left",
2986 lsuffix="",
2987 rsuffix="",
2988 shuffle_method=None,
2989 npartitions=None,
2990 ):
2991 if not isinstance(other, list) and not is_dask_collection(other):
2992 other = from_pandas(other, npartitions=1)
2993 if (
2994 not isinstance(other, list)
2995 and not is_dataframe_like(other._meta)
2996 and hasattr(other._meta, "name")
2997 ):
2998 other = new_collection(expr.ToFrame(other))
2999
3000 if not isinstance(other, FrameBase):
3001 if not isinstance(other, list) or not all(
3002 isinstance(o, FrameBase) for o in other
3003 ):
3004 raise ValueError("other must be DataFrame or list of DataFrames")
3005 if how not in ("outer", "left"):
3006 raise ValueError("merge_multi only supports left or outer joins")
3007
3008 other = [
3009 from_pandas(o, npartitions=1) if not is_dask_collection(o) else o
3010 for o in other
3011 ]
3012
3013 return new_collection(
3014 JoinRecursive([self.expr] + [o.expr for o in other], how=how)
3015 )
3016
3017 return self.merge(
3018 right=other,
3019 left_index=on is None,
3020 right_index=True,
3021 left_on=on,
3022 how=how,
3023 suffixes=(lsuffix, rsuffix),
3024 shuffle_method=shuffle_method,
3025 npartitions=npartitions,
3026 )
3027
3028 @derived_from(pd.DataFrame)
3029 def groupby(

Calls 7

mergeMethod · 0.95
is_dask_collectionFunction · 0.90
new_collectionFunction · 0.90
JoinRecursiveClass · 0.90
from_pandasFunction · 0.85
is_dataframe_likeFunction · 0.85
allFunction · 0.85