Array columns error in Jupyter notebook and lab
See original GitHub issueOn astropy version: 4.3.dev1429+ga832159 and 4.3.dev1484+g3f8cf27b8, in a jupyter lab environment, putting a particular table as the only item in a Jupyter Lab cell results in the following traceback and printed out table (MWE):
import numpy as np
from astropy.table import Table
Table([np.ones([10,10]), np.arange(10)])
results in both
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
~/anaconda3/lib/python3.7/site-packages/IPython/core/formatters.py in __call__(self, obj)
343 method = get_real_method(obj, self.print_method)
344 if method is not None:
--> 345 return method()
346 return None
347 else:
~/repos/astropy/astropy/table/table.py in _repr_latex_(self)
1549 latexdict = self.meta.get('latexdict', {})
1550 lTable = ascii.latex.Latex(latexdict=latexdict)
-> 1551 lines = lTable.write(table=self)
1552 self.meta['latexdict'] = lTable.latex
1553
~/repos/astropy/astropy/io/ascii/latex.py in write(self, table)
338 self.header.start_line = None
339 self.data.start_line = None
--> 340 return core.BaseReader.write(self, table=table)
341
342
~/repos/astropy/astropy/io/ascii/core.py in write(self, table)
1474 # Check that table column dimensions are supported by this format class.
1475 # Most formats support only 1-d columns, but some like ECSV support N-d.
-> 1476 self._check_multidim_table(table)
1477
1478 # Now use altered columns
~/repos/astropy/astropy/io/ascii/core.py in _check_multidim_table(self, table)
1282 If any column exceeds the number of allowed dimensions
1283 """
-> 1284 _check_multidim_table(table, self.max_ndim)
1285
1286 def read(self, table):
~/repos/astropy/astropy/io/ascii/core.py in _check_multidim_table(table, max_ndim)
53 nd_names = [col.info.name for col in table.itercols() if len(col.shape) > max_ndim]
54 if nd_names:
---> 55 raise ValueError(f'column(s) with dimension > {max_ndim} '
56 "cannot be be written with this format, try using 'ecsv' "
57 "(Enhanced CSV) format")
ValueError: column(s) with dimension > 1 cannot be be written with this format, try using 'ecsv' (Enhanced CSV) format
and
col0 [10] | col1
-- | --
1.0 .. 1.0 | 0
1.0 .. 1.0 | 1
1.0 .. 1.0 | 2
1.0 .. 1.0 | 3
1.0 .. 1.0 | 4
1.0 .. 1.0 | 5
1.0 .. 1.0 | 6
1.0 .. 1.0 | 7
1.0 .. 1.0 | 8
1.0 .. 1.0 | 9
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Couldn't cast array of type string error with cast_column #3668
In OVH cloud during Huggingface Robust-speech-recognition event on a AI training notebook instance using jupyter lab and running jupyter ...
Read more >Jupyter Notebook: Print 2d array, where each and every row ...
All I just want is a 28 rows and 28 columns for my 28 x 28 2d array. I'm using python on Jupyter...
Read more >Error with pandas in the Labs Python Integration - KNIME Forum
Hi all, I am trying to run a script using the Labs Python Integration node and I encounter an error that does not...
Read more >Pandas Series outputs are filled with nulls/errors : DS-2184
When I open the same notebook in browser (without re-running it), the output is shown correctly. When I close DataSpell and open the...
Read more >NUMPY Arrays Tutorial in Jupyter with examples - YouTube
This Python Numpy arrays tutorial explains how to install, creating arrays, indexing, slicing, reshape, random functions, math and ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So I just don’t understand Jupyter notebook. I took out the new check that causes problems and Jupyter runs
_repr_latex_
(now successfully) but just throws away that output and moves on to_repr_html_
.Anyway, fix coming.
and
(I tried on both machines)