I have a pandas dataframe and for one of my columns, I need to combine some of the values however I'm not sure what function to use (merge, sum, concatenate, etc.) I have a dataframe with 5 columns (postal code, borough, neighbourhood, latitude, longitude) and for the borough column, there are 10 unique boroughs however I need it to be 6 boroughs only, therefore I need to combine 4 of the boroughs(East Toronto, Downtown Toronto, West Toronto and Central Toronto)enter image description here into one borough and name this borough Old Toronto. How do I do this without losing all the neighbourhoods in the boroughs which I need to combine?
question from:https://stackoverflow.com/questions/66061898/combining-specific-rows-in-a-pandas-dataframe-into-a-new-row