Skip to content

Allow duplicate index values for to_csv #1373

Closed
@lodagro

Description

@lodagro
In [22]: df
Out[22]:
              0         1         2
A 1 2  0.659855  0.340490  0.351028
    2  0.695581  0.264714  0.389929
B   2  0.105016  0.070774  0.114629

In [23]: df.to_csv('foo.csv')
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

TypeError: only integer arrays with one element can be converted to an index

In [24]: df1
Out[24]:
          0         1         2
a  0.313015  0.631747  0.091818
a  0.505238  0.260553  0.793378
b  0.441791  0.029851  0.139490

In [25]: df1.to_csv('foo.csv')
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIO DataIO issues that don't fit into a more specific label

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions