Skip to content

BUG: str of long arrays has stray comma #9777

Closed

Description

@eric-wieser
a = np.arange(5000)
print(a)
[   0    1    2 ..., 4997 4998 4999]

Activity

  1. avirlrma commented on Oct 2, 2017

    @avirlrma

    @eric-wieser I would like to work on this.

  2. avirlrma commented on Oct 3, 2017

    @avirlrma

    @eric-wieser Can you point me in the direction?

  3. eric-wieser commented on Oct 3, 2017

    @eric-wieser
    MemberAuthor

    @aviral1701: Sure

    The _array2string function in :/numpy/core/arrayprint.py introduces this comma. Right now it always adds it, but it should only do so when called from array_repr
    You'll need to come up with some way to tell it to only do this in repr, not in str.

  4. eric-wieser commented on Oct 3, 2017

    @eric-wieser
    MemberAuthor

    Actually, just changing summary_insert = "..., " to summary_insert = "..." + separator should be enough.

    (or better, adding the separator inside _formatArray)

    You'll need to add a test too, which you can run with runtests.py

  5. nafest commented on Oct 3, 2017

    @nafest
    Contributor

    @eric-wieser: There are already tests that cover this change. Is it necessary to add an additional test?

  6. avirlrma commented on Oct 3, 2017

    @avirlrma

    @nafest I was supposed to be doing this as already mentioned above.Why did you commit then?

  7. nafest commented on Oct 3, 2017

    @nafest
    Contributor

    @aviral1701 sorry I fixed that yesterday. Didn't know I had to comment that I am working on this.

  8. avirlrma commented on Oct 3, 2017

    @avirlrma

    @eric-wieser I would suggest that we add some guidelines in Contributing guide to avoid duplicacy of work which harm the contribution spirit.

  9. added a commit that references this issue on Oct 3, 2017
    80c624e
  10. added a commit that references this issue on Oct 23, 2017
    b6f16ad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions