How would I extract any word after second hyphen in pandas

Below is my DF df = pd.DataFrame({'A': ['a', 'b', 'c', '0'], 'B': ['0xF188-abc-cde', '0xF188-abc-abcde', '0xF188-abc-1234', '0xF188-abc-tu231er']}) Now I want to add NEW column “EXTRACT” which is an extraction of column ‘B’ after second hyphen. Below is the Expected Column. df= pd.DataFrame({'A': ['a', 'b', 'c', '0'], 'B': ["0xF188-abc-cde", '0xF188-abc-abcde', '0xF188-abc-1234', '0xF188-abc-tu231er'], 'Extract':['cde', 'abcde', '1234', 'tu231er']}) Answers: … Read more

How to modify one column’s null values based on another column?

I have 12 columns of ingredients and 12 respective columns of measurements of those ingredients. For some rows the ingredients are specified but the measurements are not i.e. they are NA. I want to set up a condition such that if a certain ingredient entry is not NA and the corresponding entry is NA, set the corresponding measurement entry to 1.

Pandas Dataframe Generating Two new columns in a Dataframe that generate a count based on Conditional Parameters

Thank you for your time. I am not an advanced programmer. I am taking 1 programming course. I understand the basics and an okay amount of Python. Please don’t destroy the little confidence I have in programming. I realize the answer may exist but I haven’t found it yet with my searching skills.