I am learning to use python for data science and I have a dataset "Comcast complaints" in which there is a column called "Status" which contains the following strings.
How can I use if else condition to categorize strings of "Open" & "Pending" as "Open Cases", "Closed" & "Solved" as "Closed Cases"
comcast_df['Status_New'] = comcast_df["Open Cases" if Status=="Open" or Status=="Pending" else "Closed Cases" for Status in comcast_df["Status"]]
I attempted the above line but it is going nowhere. I would appreciate any help in figuring out where I am going wrong.