79345600

Date: 2025-01-10 11:54:22
Score: 2.5
Natty:
Report link

My dataframe was deleting more rows than I expected. So people with my problem might see this page too. The answer was that I needed to precede the drop line with a reset_index line. Python was finding the index that needed deleting but there were duplicates of that index; so loads of rows got deleted that should have stayed. reset_index gave a unique index to the dataframe; and solved my issue.

Reasons:
  • Blacklisted phrase (0.5): I need
  • No code block (0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Mike C