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

Nonsensical table names on pd.concat #135

Open
guilhermebs opened this issue Mar 6, 2023 · 0 comments
Open

Nonsensical table names on pd.concat #135

guilhermebs opened this issue Mar 6, 2023 · 0 comments
Assignees

Comments

@guilhermebs
Copy link
Contributor

import pdtable
import pandas as pd


tables = [
    pdtable.Table(
        pd.DataFrame({
            "col1": [1, 2],
            "col2": ["a", "b"]
        }),
        name="t1"
    ),
    pdtable.Table(
        pd.DataFrame({
            "col1": [3, 4],
            "col2": ["c", "d"]
        }),
        name="t2"
    ),
]


concat = pd.concat([t.df for t in tables], keys=[t.name for t in tables])

print(pdtable.Table(concat).name)
# >>> t1

expected behaviour: in the absence of a metadata that makes sense for all tables, the concat operation should return a plain pd.DataFrame

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants