HF RL Explorer

Task: Keep Index When Using Pandas Merge

Task: Keep Index When Using Pandas Merge: a task in Terminal-Lego-15k (Harbor dataset). When merging two pandas DataFrames using pd.merge() or df.merge() , the resulting DataFrame loses the index from the original (left) DataFrame and resets it to a default integer index. Your task is to write a…

The task

When merging two pandas DataFrames using `pd.merge()` or `df.merge()`, the resulting DataFrame loses the index from the original (left) DataFrame and resets it to a default integer index. Your task is to write a Python script that merges two DataFrames while preserving the index from the left DataFrame.

Part of PrimeIntellect/Terminal-Lego-15k.