I'm trying to generate a file out of a single Column object.
A file with a single columns should be generated.
The elements in the column are converted to columns.
import numpy as np
from astropy.io import ascii
from astropy.table import Table, Column
aa = np.random.uniform(0., 1., 100)
cc = Column(aa, name='data')
# Does not work
ascii.write(cc, 'data.dat')
# Converting to table has the same issue
tt = Table(cc)
Linux-5.5.0-050500-generic-x86_64-with-glibc2.10
Python 3.8.5 (default, Sep 4 2020, 07:30:14)
[GCC 7.3.0]
Numpy 1.19.1
astropy 4.0.1.post1
Scipy 1.5.2
Matplotlib 3.3.1
tt = Table([cc]) works for me.
It does indeed. It also works with ascii.write([cc], 'data.dat'). I think this behaviour is a bit non-intuitive, but there's no bug here so closing. Thank you!
There is an example at https://docs.astropy.org/en/latest/table/construct_table.html#list-of-columns but perhaps it is not obvious that a list is still necessary even if you only have one column. I am glad that works for you! 馃槃