Skip to content

Formatted output in io.ascii can generate incorrect column type #335

Closed

Description

@taldcroft

The a column is formatted with the formats kwarg but the output column is misinterpreted as a string-valued column because of the included spaces:

In [30]: io.ascii.write([[1, 2]], names=['a', 'b'], formats={'a':'%5.2f'})
a b
" 1.00" 2

Expected output is:

In [31]: asciitable.write([[1, 2]], names=['a', 'b'], formats={'a':'%.2f'})
a b
1.00 2

Have not yet looked at the code to see where and how to fix this.

Activity

  1. added a commit that references this issue on Oct 9, 2013
    a9cc271
  2. added a commit that references this issue on Jun 12, 2019
  3. added a commit that references this issue on Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions