BUG: DataFrame subplot with duplicated columns output incorrect result #10962

Merged
merged 1 commit into from Sep 5, 2015

Conversation

Projects
None yet
2 participants
Member

sinhrks commented Sep 1, 2015

When DataFrame has duplicated column name, each subplot will contain all the lines with same name.

import pandas as pd
import numpy as np
df = pd.DataFrame(np.random.rand(5, 5), columns=list('aaaaa'))
df.plot(subplots=True)

figure_1

sinhrks added this to the 0.17.0 milestone Sep 1, 2015

@jreback jreback commented on an outdated diff Sep 4, 2015

pandas/tests/test_graphics.py
@@ -1646,6 +1646,27 @@ def test_subplots_sharex_axes_existing_axes(self):
for ax in axes.ravel():
self._check_visible(ax.get_yticklabels(), visible=True)
+ @slow
+ def test_subplots_dup_columns(self):
+ df = DataFrame(np.random.rand(5, 5), columns=list('aaaaa'))
@jreback

jreback Sep 4, 2015

Contributor

add the issue/pr number as a comment

Contributor

jreback commented Sep 4, 2015

minor comment, lgtm, merged on pass

Member

sinhrks commented Sep 5, 2015

Thanks for review. Fixed and merging.

@sinhrks sinhrks added a commit that referenced this pull request Sep 5, 2015

@sinhrks sinhrks Merge pull request #10962 from sinhrks/plot_dupcolumns
BUG: DataFrame subplot with duplicated columns output incorrect result
1c280cf

@sinhrks sinhrks merged commit 1c280cf into pandas-dev:master Sep 5, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

sinhrks deleted the sinhrks:plot_dupcolumns branch Sep 5, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment