Skip to content

Series/Dataframe to_csv inconsistency when path=None [0.14.1] #8215

Closed
@ischwabacher

Description

@ischwabacher

It looks like Series.to_csv and DataFrame.to_csv differ in their handling of path=None:

In [1]: import pandas as pd

In [2]: print pd.Series([1, 1, 1], index=[1, 2, 3]).to_csv(None)
None

In [3]: print pd.DataFrame([1, 1, 1], index=[1, 2, 3]).to_csv(None)
,0
1,1
2,1
3,1

I haven't gone digging yet but I expect these two methods share enough code that this is a trivial fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Compatpandas objects compatability with Numpy or Python functionsIO CSVread_csv, to_csv

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions