Skip to content

Commit

Permalink
BUG: iteritems and _series not assigning Series.name
Browse files Browse the repository at this point in the history
  • Loading branch information
wesm committed Oct 15, 2011
1 parent 8b86400 commit 7838309
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 3 additions & 0 deletions RELEASE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ leading to some of the minor API changes listed below.
be reported upstream to matplotlib (GH #224)
- Fixed problem in which data would get upcasted to object dtype in
GroupBy.apply operations (GH #237)
- Fixed outer join bug with empty DataFrame (GH #238)
- DataFrame.iteritems was not returning Series with the name attribute
set. Also neither was DataFrame._series

pandas 0.4.3
============
Expand Down
3 changes: 1 addition & 2 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,7 @@ def __iter__(self):

def iteritems(self):
"""Iterator over (column, series) pairs"""
series = self._series
return ((k, series[k]) for k in self.columns)
return ((k, self[k]) for k in self.columns)

iterkv = iteritems
if py3compat.PY3:
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ def _blocks_to_series_dict(blocks, index=None):

for block in blocks:
for item, vec in zip(block.items, block.values):
series_dict[item] = Series(vec, index=index)
series_dict[item] = Series(vec, index=index, name=item)
return series_dict

def _interleaved_dtype(blocks):
Expand Down

0 comments on commit 7838309

Please sign in to comment.