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
ValueError
np.array
Follow up to: pandas-dev/pandas#59588
tabulate can handle lists [1, 2] as cell values but not numpy arrays np.array([1, 2]):
tabulate
[1, 2]
np.array([1, 2])
>>> print(tabulate([[[1, 2], 3]])) ------ - [1, 2] 3 ------ - >>> print(tabulate([[np.array([1, 2]), 3]])) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/john/GitHub/os/envs/numpy/lib/python3.12/site-packages/tabulate/__init__.py", line 2048, in tabulate list_of_lists, headers = _normalize_tabular_data( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/john/GitHub/os/envs/numpy/lib/python3.12/site-packages/tabulate/__init__.py", line 1471, in _normalize_tabular_data rows = list(map(lambda r: r if _is_separating_line(r) else list(r), rows)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/john/GitHub/os/envs/numpy/lib/python3.12/site-packages/tabulate/__init__.py", line 1471, in <lambda> rows = list(map(lambda r: r if _is_separating_line(r) else list(r), rows)) ^^^^^^^^^^^^^^^^^^^^^^ File "/home/john/GitHub/os/envs/numpy/lib/python3.12/site-packages/tabulate/__init__.py", line 107, in _is_separating_line (len(row) >= 1 and row[0] == SEPARATING_LINE) ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
I'd expect a similar behavior or at least something like:
---------------- - np.array([1, 2]) 3 ---------------- -
The text was updated successfully, but these errors were encountered:
to_markdown
➕ I am hitting the same issue.
Sorry, something went wrong.
No branches or pull requests
Follow up to: pandas-dev/pandas#59588
tabulate
can handle lists[1, 2]
as cell values but not numpy arraysnp.array([1, 2])
:I'd expect a similar behavior or at least something like:
The text was updated successfully, but these errors were encountered: