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

[BUG] Appending along columns not working without suffix argument #65

Closed
Priya2698 opened this issue Jun 12, 2021 · 2 comments
Closed

Comments

@Priya2698
Copy link
Collaborator

Appending to a DataPanel along columns does not work without suffix argument even when the column names do not overlap.

dp = ms.DataPanel({
    'text': ['The quick brown fox.', 'Jumped over.', 'The lazy dog.'],
    'label': [0, 1, 0]
})
dp2 = ms.DataPanel({
    'string': ['The quick brown fox.', 'Jumped over.', 'The lazy dog.'],
    'target': [0, 1, 0]
})
dp.append(dp2, axis=1)

This code throws ValueError. It works when I provide any suffix, although they are not used.

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-18-5f32282aa054> in <module>()
----> 1 dp.append(dp2, axis=1)

1 frames
/usr/local/lib/python3.7/dist-packages/mosaic/datapanel.py in append(self, dp, axis, suffixes, overwrite)
    422             if not overwrite and shared:
    423                 if suffixes is None:
--> 424                     raise ValueError()
    425                 left_suf, right_suf = suffixes
    426                 data = {

ValueError:
@Priya2698
Copy link
Collaborator Author

The "index" column is always a shared column between any two DataPanels, hence suffixes are always needed right now

@seyuboglu
Copy link
Collaborator

This is now example is now working smoothly in dev

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