Skip to content

Is there any fast way to apply crossjoin or join not on two dataframes? #19614

Closed
@ftune

Description

@ftune

I try to find way to apply cross join on pandas. Failed to find useful suggestion in pandas document.
Like
SELECT * FROM [GameScores] CROSS JOIN [Departments] or SELECT * FROM [GameScores] JOIN [Departments] on [GameScores].t1 != [Departments].t1

I get one possible answer like:
import itertools list=[x for x in itertools.product([a,b,c,d],[1,2,3,4])] df=pd.DataFrame(list)
But I'm wondering without numpy tools it might be cost much time while apply this on two large dataframe or series.

Is there any tools in pandas for this two operations?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions