Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ftune opened this issue Feb 9, 2018 · 1 comment
Closed
Labels
Duplicate Report Duplicate issue or pull request Usage Question

Comments

@ftune
Copy link

ftune commented Feb 9, 2018

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?

@jreback
Copy link
Contributor

jreback commented Feb 9, 2018

see #5401

@jreback jreback closed this as completed Feb 9, 2018
@jreback jreback added Usage Question Duplicate Report Duplicate issue or pull request labels Feb 9, 2018
@jreback jreback added this to the No action milestone Feb 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate Report Duplicate issue or pull request Usage Question
Projects
None yet
Development

No branches or pull requests

2 participants