Skip to content

Generic alignment function and new module core.align #4336

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

Closed
cpcloud opened this issue Jul 23, 2013 · 2 comments
Closed

Generic alignment function and new module core.align #4336

cpcloud opened this issue Jul 23, 2013 · 2 comments
Assignees
Labels
API Design Internals Related to non-user accessible pandas implementation
Milestone

Comments

@cpcloud
Copy link
Member

cpcloud commented Jul 23, 2013

A new module core.align would hold a couple of generic alignment functions, one of which will be align_multiple or possibly align2 (taking 2 pandas objects) and then align would take a sequence of pandas objects to align.

Need to think about the API a bit more.

Psuedocode-ish:

df = DataFrame(...)
df2 = DataFrame(...) # possibly different index and columns than df
s = Series(...)
result = pd.align([df, df2, s], how='outer') # compute the union of the indexes

# smoke test 1
result.columns == df.columns.join(df2.columns, how='outer').join(s.index, how='outer')
result.index == df.index.join(df2.index, how='outer')

result2 = pd.align([df, df2, s], how='inner') # intersection

# smoke test 2
result2.columns == df.columns.join(df2.columns).join(s.index)
result2.index == df.index.join(df2.index)

input with Index types would return the union/intersection of the objects. not clear what would happen if aligning an Index and another non-Index pandas object

@jreback
Copy link
Contributor

jreback commented Sep 27, 2013

think still worth it? either make someday or close...

@cpcloud
Copy link
Member Author

cpcloud commented Sep 27, 2013

meh

@cpcloud cpcloud closed this as completed Sep 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design Internals Related to non-user accessible pandas implementation
Projects
None yet
Development

No branches or pull requests

2 participants