Skip to content

Drop row with duplicated index #929

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

Closed
wants to merge 2 commits into from
Closed

Conversation

riverset
Copy link

There are cases in yahoo data where there are duplicated rows, this simple fix will remove the second duplicated row if it exists. A stack overflow thread that contains people facing this error is https://stackoverflow.com/questions/57885790/valueerror-index-contains-duplicate-entries-cannot-reshape-pandas-datareader

  • closes #xxxx
  • tests added / passed
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • passes black --check pandas_datareader
  • added entry to docs/source/whatsnew/vLATEST.txt

There are cases in yahoo data where there are duplicated rows, this fix will remove the second duplicated row if it exists.  A stack overflow thread that contains people facing this error is https://stackoverflow.com/questions/57885790/valueerror-index-contains-duplicate-entries-cannot-reshape-pandas-datareader
Extra line was causing Check style and formatting to fail, hence removed it
@bashtage
Copy link
Contributor

What if the values differ but he index doesn't? Should PDR return what Yahoo does?

@bashtage
Copy link
Contributor

I think you should only drop if the row is identical and the index is identical.

@riverset riverset closed this Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants