-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
With astropy-3.2.1 and numpy-1.16.4 I can create one table from the rows of another, as follows:
>>> from astropy.table import Table
>>> t = Table([[1, 2, 3], [4, 5, 6]], names=('a', 'b'))
>>> print(t)
a b
--- ---
1 4
2 5
3 6
>>> print(type(t)(rows=[row for row in t], names=t.dtype.names))
a b
--- ---
1 4
2 5
3 6However, with the same astropy, and numpy-1.17.0rc1 I cannot (well, I can, it just doesn't do what I expect it to):
>>> from astropy.table import Table
>>> t = Table([[1, 2, 3], [4, 5, 6]], names=('a', 'b'))
>>> print(t)
a b
--- ---
1 4
2 5
3 6
>>> print(type(t)(rows=[row for row in t], names=t.dtype.names))
a [2] b [2]
------ ------
1 .. 4 1 .. 4
2 .. 5 2 .. 5
3 .. 6 3 .. 6If I manually cast each row to list, then things do work again:
>>> print(type(t)(rows=[list(row) for row in t], names=t.dtype.names))
a b
--- ---
1 4
2 5
3 6Is this just a consequence of an upstream change in the new pre-release of numpy, or are tables not really supposed to be created this way in the first place?
Reactions are currently unavailable