ASCII table reader drops meta data for empty table
See original GitHub issueHi!
Firstly thanks for all the great work!!
Secondly, it may be a stupid question (or I’m incompetent when it comes to reading the docs), but it seems that ascii.read
drops any meta data when passed an empty table. Is there a way to force it to keep the comments even if the table is empty?
Here’s what I have:
>>> from astropy.io import ascii
>>>
>>> tbl = ascii.read("""
... # hello
... # world
... name place
... """)
>>>
>>> tbl.meta
OrderedDict()
When reading the empty table, the .meta
dict is empty, even though there are comments
>>> tbl = ascii.read("""
... # hello
... # world
... name place
... earth home
... """)
>>>
>>> tbl.meta
OrderedDict([('comments', ['hello', 'world'])])
But as soon as there is one or more entries in the table, the .meta
contains the comments.
Is there anyway around this? Maybe by specifying a specific reader?
Many thanks for all you do!
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Reading Tables — Astropy v5.2
ASCII data tables can contain bad or missing values. A common case is when a table contains blank entries with no available data....
Read more >Create and use tables | BigQuery - Google Cloud
You can create an empty table with a schema definition in the following ways: ... If the cached metadata is older than that,...
Read more >Table SQL Statements - Dremio docs
The following SQL commands are documented on this page: CREATE TABLE AS; DESCRIBE TABLE; ALTER TABLE; DROP TABLE. CREATE TABLE AS. The CREATE...
Read more >Analyzing tables - Amazon Redshift - AWS Documentation
The ANALYZE operation updates the statistical metadata that the query planner uses to build and choose optimal plans.
Read more >asciitable 0.8.0 documentation
Asciitable can read and write a wide range of ASCII table formats via ... empty data value in the x or y columns...
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
See #8274 for a fix.
@taldcroft Brilliant! Thanks heaps for the tip. I wasn’t overjoyed by my workaround 😃