Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 5, 2015

Conversation

sinhrks
Copy link
Member

@sinhrks 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 sinhrks added this to the 0.17.0 milestone Sep 1, 2015
@sinhrks sinhrks force-pushed the plot_dupcolumns branch 3 times, most recently from 5036e61 to 384bbe1 Compare September 3, 2015 20:44
@@ -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'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add the issue/pr number as a comment

@jreback
Copy link
Contributor

jreback commented Sep 4, 2015

minor comment, lgtm, merged on pass

@sinhrks
Copy link
Member Author

sinhrks commented Sep 5, 2015

Thanks for review. Fixed and merging.

sinhrks added a commit that referenced this pull request Sep 5, 2015
BUG: DataFrame subplot with duplicated columns output incorrect result
@sinhrks sinhrks merged commit 1c280cf into pandas-dev:master Sep 5, 2015
@sinhrks sinhrks deleted the plot_dupcolumns branch September 5, 2015 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants