Skip to content

Commit

Permalink
BUG: return nameless Series and index from from_csv
Browse files Browse the repository at this point in the history
  • Loading branch information
wesm committed Jun 27, 2012
1 parent 3657093 commit 6078fba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -2310,7 +2310,9 @@ def from_csv(cls, path, sep=',', parse_dates=True, header=None,
df = DataFrame.from_csv(path, header=header, index_col=index_col,
sep=sep, parse_dates=parse_dates,
encoding=encoding)
return df.ix[:, 0]
result = df.ix[:, 0]
result.index.name = result.name = None
return result

def to_csv(self, path, index=True, sep=",", na_rep='', header=False,
index_label=None, mode='w', nanRep=None, encoding=None):
Expand Down
2 changes: 2 additions & 0 deletions pandas/tests/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1879,6 +1879,8 @@ def test_from_csv(self):

self.series.to_csv('_foo')
series = Series.from_csv('_foo')
self.assert_(series.name is None)
self.assert_(series.index.name is None)
assert_series_equal(self.series, series)

outfile = open('_foo', 'w')
Expand Down

0 comments on commit 6078fba

Please sign in to comment.