pandas-datareader icon indicating copy to clipboard operation
pandas-datareader copied to clipboard

Drop row with duplicated index

Open prakhar-dhakar opened this issue 3 years ago • 2 comments

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

prakhar-dhakar avatar Mar 13 '22 07:03 prakhar-dhakar

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

bashtage avatar Mar 16 '22 23:03 bashtage

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

bashtage avatar Mar 16 '22 23:03 bashtage