I am working on a dataframe that displays the amount of offices in each state. I am looking to combine the office count value in the state of CA which is split up into 2 separate rows/indexes.
Welcome to Stack Overflow. Please read how to ask good questions. Make sure your question covers these 3 elements: 1. Problem Statement 2. Your Code (it should be Minimal, Reproducible Example 3. Error Message (preferably full Traceback to help others review and provide feedback). Sometimes the same question may have already been asked. Make sure your question is not a duplicate
df.groupby('state')['office_count'].sum()to get you the sum by state25and13important for you? If yes, what do you want to do about them? If not, the above groupby will address the problem