When working with data in Python, particularly with pandas DataFrames, it is often necessary to create new columns based on the values in existing columns. One common task is to cr...