We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
One can initialize a misc table with None as index:
None
>>> import audformat >>> table = audformat.MiscTable(None)
But this let's some of its method fail:
>>> table.copy() ... ValueError: Got index with levels [None], but names must be non-empty and unique. >>> table.extend_index(pd.Index([0, 1, 2], name="idx")) ... ValueError: Got index with levels [None], but names must be non-empty and unique. >>> table.extend_index(pd.Index([0, 1, 2], name="idx"), inplace=True) ValueError: Cannot extend table if input index and table index are not alike. Expected index: idx int64 but yours is: None int64
You can extend the table with:
>>> table.extend_index(pd.Index([0, 1, 2]), inplace=True) >>> table.index Index([0, 1, 2], dtype='Int64')
But now you have created a table without a name for the index and empty levels:
levels
>>> table.levels
If you would have tried this when creating the table, it would have failed with
>>> table = audformat.MiscTable(pd.Index([0, 1, 2])) ... ValueError: Got index with levels [None], but names must be non-empty and unique.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
One can initialize a misc table with
None
as index:But this let's some of its method fail:
You can extend the table with:
But now you have created a table without a name for the index and empty
levels
:If you would have tried this when creating the table, it would have failed with
The text was updated successfully, but these errors were encountered: