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
Describe the bug If I try to export a table with a rather complex table heading, for example created by pint_pandas I get an error.
pint_pandas
To reproduce I have a notebook with the following content
import pandas as pd import numpy as np df = pd.DataFrame(np.random.randn(6, 4), columns=[list("1122"), list("ABCD")]) df.index.name = "custom-index" df.columns.names = (None, "unit")
An export fails with the following error
[Application] ERROR | nbconvert failed: Must pass non-zero number of levels/codes Traceback (most recent call last): File "C:\minforge\lib\site-packages\jupyter_server\nbconvert\handlers.py", line 131, in get output, resources = await run_sync( File "C:\minforge\lib\site-packages\anyio\to_thread.py", line 31, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "C:\minforge\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread return await future File "C:\minforge\lib\asyncio\futures.py", line 284, in __await__ yield self # This tells Task to wait for completion. File "C:\minforge\lib\asyncio\tasks.py", line 304, in __wakeup future.result() File "C:\minforge\lib\asyncio\futures.py", line 201, in result raise self._exception File "C:\minforge\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run result = context.run(func, *args) File "C:\minforge\lib\site-packages\jupyter_server\nbconvert\handlers.py", line 132, in <lambda> lambda: exporter.from_notebook_node(nb, resources=resource_dict) File "C:\minforge\lib\site-packages\jupyter_docx_bundler\__init__.py", line 79, in from_notebook_node converters.notebookcontent_to_docxbytes( File "C:\minforge\lib\site-packages\jupyter_docx_bundler\converters.py", line 262, in notebookcontent_to_docxbytes content = preprocess(content, path, handler=handler) File "C:\minforge\lib\site-packages\jupyter_docx_bundler\converters.py", line 193, in preprocess raise e File "C:\minforge\lib\site-packages\jupyter_docx_bundler\converters.py", line 185, in preprocess html_to_pandas_table(output['data']['text/html']).to_markdown(), File "C:\minforge\lib\site-packages\jupyter_docx_bundler\converters.py", line 94, in html_to_pandas_table df.set_index(index_column_names, inplace=True) File "C:\minforge\lib\site-packages\pandas\util\_decorators.py", line 311, in wrapper return func(*args, **kwargs) File "C:\minforge\lib\site-packages\pandas\core\frame.py", line 5555, in set_index index = ensure_index_from_sequences(arrays, names) File "C:\minforge\lib\site-packages\pandas\core\indexes\base.py", line 6984, in ensure_index_from_sequences return MultiIndex.from_arrays(sequences, names=names) File "C:\minforge\lib\site-packages\pandas\core\indexes\multi.py", line 493, in from_arrays return cls( File "C:\minforge\lib\site-packages\pandas\core\indexes\multi.py", line 321, in __new__ raise ValueError("Must pass non-zero number of levels/codes") ValueError: Must pass non-zero number of levels/codes
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered:
Add failing test from issue #89
2ce2c9c
m-rossi
Successfully merging a pull request may close this issue.
Describe the bug
If I try to export a table with a rather complex table heading, for example created by
pint_pandas
I get an error.To reproduce
I have a notebook with the following content
An export fails with the following error
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: